home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was processed as: Tape Archive
(archive/tar).
You can browse this item here: libauth-4.0-p5.tar
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| Tape Archive (archive/tar)
| magic
| Supported |
100%
| file
| tar archive
| default
| |
99%
| file
| tar archive (V7), file libauth-4.0-p5/, mode 755 , uid 171 , gid 36 , size 0 , seconds 5400732474
| default
| |
98%
| file
| data
| default
| |
100%
| lsar
| Tar
| default
| |
100%
| gt2
| TAR Archiv gefunden (Auflistung ist deaktiviert)
| default
| |
100%
| disktype
| Pre-POSIX tar archive
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 6c 69 62 61 75 74 68 2d | 34 2e 30 2d 70 35 2f 00 |libauth-|4.0-p5/.|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000050| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000060| 00 00 00 00 20 20 20 37 | 35 35 20 00 20 20 20 31 |.... 7|55 . 1|
|00000070| 37 31 20 00 20 20 20 20 | 33 36 20 00 20 20 20 20 |71 . |36 . |
|00000080| 20 20 20 20 20 20 30 20 | 20 35 34 30 30 37 33 32 | 0 | 5400732|
|00000090| 34 37 34 20 20 20 36 33 | 30 30 00 20 00 00 00 00 |474 63|00. ....|
|000000a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000100| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000110| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000120| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000130| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000140| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000150| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000160| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000170| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000180| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000190| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000200| 6c 69 62 61 75 74 68 2d | 34 2e 30 2d 70 35 2f 61 |libauth-|4.0-p5/a|
|00000210| 75 74 68 75 73 65 72 2e | 33 00 00 00 00 00 00 00 |uthuser.|3.......|
|00000220| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000230| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000240| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000250| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000260| 00 00 00 00 20 20 20 36 | 34 34 20 00 20 20 20 31 |.... 6|44 . 1|
|00000270| 37 31 20 00 20 20 20 20 | 33 36 20 00 20 20 20 20 |71 . |36 . |
|00000280| 20 20 31 32 37 37 36 20 | 20 35 33 33 33 34 34 35 | 12776 | 5333445|
|00000290| 36 30 30 20 20 31 30 33 | 34 33 00 20 00 00 00 00 |600 103|43. ....|
|000002a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000300| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000310| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000320| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000330| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000340| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000350| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000360| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000370| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000380| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000390| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000400| 2e 54 48 20 61 75 74 68 | 75 73 65 72 20 33 0a 2e |.TH auth|user 3..|
|00000410| 53 48 20 4e 41 4d 45 0a | 61 75 74 68 75 73 65 72 |SH NAME.|authuser|
|00000420| 20 5c 2d 20 72 65 6d 6f | 74 65 20 61 75 74 68 65 | \- remo|te authe|
|00000430| 6e 74 69 63 61 74 69 6f | 6e 20 6c 69 62 72 61 72 |nticatio|n librar|
|00000440| 79 20 75 73 69 6e 67 20 | 74 68 65 20 41 75 74 68 |y using |the Auth|
|00000450| 65 6e 74 69 63 61 74 69 | 6f 6e 20 53 65 72 76 65 |enticati|on Serve|
|00000460| 72 0a 2e 53 48 20 53 59 | 4e 54 41 58 0a 2e 42 20 |r..SH SY|NTAX..B |
|00000470| 23 69 6e 63 6c 75 64 65 | 20 3c 61 75 74 68 75 73 |#include| <authus|
|00000480| 65 72 2e 68 3e 0a 0a 75 | 6e 73 69 67 6e 65 64 20 |er.h>..u|nsigned |
|00000490| 73 68 6f 72 74 20 5c 66 | 42 61 75 74 68 5f 74 63 |short \f|Bauth_tc|
|000004a0| 70 70 6f 72 74 5c 66 52 | 3b 0a 0a 63 68 61 72 20 |pport\fR|;..char |
|000004b0| 2a 5c 66 42 61 75 74 68 | 5f 78 6c 69 6e 65 28 5c |*\fBauth|_xline(\|
|000004c0| 66 49 75 73 65 72 2c 66 | 64 2c 26 69 6e 72 65 6d |fIuser,f|d,&inrem|
|000004d0| 6f 74 65 5c 66 42 29 5c | 66 52 3b 0a 0a 69 6e 74 |ote\fB)\|fR;..int|
|000004e0| 20 5c 66 42 61 75 74 68 | 5f 66 64 28 5c 66 49 66 | \fBauth|_fd(\fIf|
|000004f0| 64 2c 26 69 6e 72 65 6d | 6f 74 65 2c 26 6c 6f 63 |d,&inrem|ote,&loc|
|00000500| 61 6c 2c 26 72 65 6d 6f | 74 65 5c 66 42 29 5c 66 |al,&remo|te\fB)\f|
|00000510| 52 3b 0a 2e 62 72 0a 69 | 6e 74 20 5c 66 42 61 75 |R;..br.i|nt \fBau|
|00000520| 74 68 5f 66 64 32 28 5c | 66 49 66 64 2c 26 69 6e |th_fd2(\|fIfd,&in|
|00000530| 6c 6f 63 61 6c 2c 26 69 | 6e 72 65 6d 6f 74 65 2c |local,&i|nremote,|
|00000540| 26 6c 6f 63 61 6c 2c 26 | 72 65 6d 6f 74 65 5c 66 |&local,&|remote\f|
|00000550| 42 29 5c 66 52 3b 0a 0a | 69 6e 74 20 5c 66 42 61 |B)\fR;..|int \fBa|
|00000560| 75 74 68 5f 74 63 70 73 | 6f 63 6b 28 5c 66 49 66 |uth_tcps|ock(\fIf|
|00000570| 64 2c 69 6e 6c 6f 63 61 | 6c 2c 69 6e 72 65 6d 6f |d,inloca|l,inremo|
|00000580| 74 65 5c 66 42 29 5c 66 | 52 3b 0a 0a 63 68 61 72 |te\fB)\f|R;..char|
|00000590| 20 2a 5c 66 42 61 75 74 | 68 5f 74 63 70 75 73 65 | *\fBaut|h_tcpuse|
|000005a0| 72 28 5c 66 49 69 6e 72 | 65 6d 6f 74 65 2c 6c 6f |r(\fIinr|emote,lo|
|000005b0| 63 61 6c 2c 72 65 6d 6f | 74 65 5c 66 42 29 5c 66 |cal,remo|te\fB)\f|
|000005c0| 52 3b 0a 2e 62 72 0a 63 | 68 61 72 20 2a 5c 66 42 |R;..br.c|har *\fB|
|000005d0| 61 75 74 68 5f 74 63 70 | 75 73 65 72 32 28 5c 66 |auth_tcp|user2(\f|
|000005e0| 49 69 6e 6c 6f 63 61 6c | 2c 69 6e 72 65 6d 6f 74 |Iinlocal|,inremot|
|000005f0| 65 2c 6c 6f 63 61 6c 2c | 72 65 6d 6f 74 65 5c 66 |e,local,|remote\f|
|00000600| 42 29 5c 66 52 3b 0a 2e | 62 72 0a 63 68 61 72 20 |B)\fR;..|br.char |
|00000610| 2a 5c 66 42 61 75 74 68 | 5f 74 63 70 75 73 65 72 |*\fBauth|_tcpuser|
|00000620| 33 28 5c 66 49 69 6e 6c | 6f 63 61 6c 2c 69 6e 72 |3(\fIinl|ocal,inr|
|00000630| 65 6d 6f 74 65 2c 6c 6f | 63 61 6c 2c 72 65 6d 6f |emote,lo|cal,remo|
|00000640| 74 65 2c 63 74 69 6d 65 | 6f 75 74 5c 66 42 29 5c |te,ctime|out\fB)\|
|00000650| 66 52 3b 0a 2e 62 72 0a | 63 68 61 72 20 2a 5c 66 |fR;..br.|char *\f|
|00000660| 42 61 75 74 68 5f 74 63 | 70 75 73 65 72 34 28 5c |Bauth_tc|puser4(\|
|00000670| 66 49 69 6e 6c 6f 63 61 | 6c 2c 69 6e 72 65 6d 6f |fIinloca|l,inremo|
|00000680| 74 65 2c 6c 6f 63 61 6c | 2c 72 65 6d 6f 74 65 2c |te,local|,remote,|
|00000690| 63 74 69 6d 65 6f 75 74 | 2c 72 74 69 6d 65 6f 75 |ctimeout|,rtimeou|
|000006a0| 74 5c 66 42 29 5c 66 52 | 3b 0a 0a 63 68 61 72 20 |t\fB)\fR|;..char |
|000006b0| 2a 5c 66 42 61 75 74 68 | 5f 73 6f 63 6b 75 73 65 |*\fBauth|_sockuse|
|000006c0| 72 28 5c 66 49 73 2c 6c | 6f 63 61 6c 2c 72 65 6d |r(\fIs,l|ocal,rem|
|000006d0| 6f 74 65 5c 66 42 29 5c | 66 52 3b 0a 0a 63 68 61 |ote\fB)\|fR;..cha|
|000006e0| 72 20 2a 5c 66 49 75 73 | 65 72 5c 66 50 3b 0a 2e |r *\fIus|er\fP;..|
|000006f0| 62 72 0a 69 6e 74 20 5c | 66 49 66 64 5c 66 50 3b |br.int \|fIfd\fP;|
|00000700| 0a 2e 62 72 0a 69 6e 74 | 20 5c 66 49 73 5c 66 50 |..br.int| \fIs\fP|
|00000710| 3b 0a 2e 62 72 0a 75 6e | 73 69 67 6e 65 64 20 6c |;..br.un|signed l|
|00000720| 6f 6e 67 20 5c 66 49 69 | 6e 6c 6f 63 61 6c 5c 66 |ong \fIi|nlocal\f|
|00000730| 50 3b 0a 2e 62 72 0a 75 | 6e 73 69 67 6e 65 64 20 |P;..br.u|nsigned |
|00000740| 6c 6f 6e 67 20 5c 66 49 | 69 6e 72 65 6d 6f 74 65 |long \fI|inremote|
|00000750| 5c 66 50 3b 0a 2e 62 72 | 0a 75 6e 73 69 67 6e 65 |\fP;..br|.unsigne|
|00000760| 64 20 73 68 6f 72 74 20 | 5c 66 49 6c 6f 63 61 6c |d short |\fIlocal|
|00000770| 5c 66 50 3b 0a 2e 62 72 | 0a 75 6e 73 69 67 6e 65 |\fP;..br|.unsigne|
|00000780| 64 20 73 68 6f 72 74 20 | 5c 66 49 72 65 6d 6f 74 |d short |\fIremot|
|00000790| 65 5c 66 50 3b 0a 2e 62 | 72 0a 69 6e 74 20 5c 66 |e\fP;..b|r.int \f|
|000007a0| 49 74 69 6d 65 6f 75 74 | 5c 66 50 3b 0a 2e 53 48 |Itimeout|\fP;..SH|
|000007b0| 20 44 45 53 43 52 49 50 | 54 49 4f 4e 0a 54 68 65 | DESCRIP|TION.The|
|000007c0| 0a 2e 42 20 61 75 74 68 | 75 73 65 72 0a 6c 69 62 |..B auth|user.lib|
|000007d0| 72 61 72 79 20 70 72 6f | 76 69 64 65 73 20 61 20 |rary pro|vides a |
|000007e0| 73 69 6d 70 6c 65 20 69 | 6e 74 65 72 66 61 63 65 |simple i|nterface|
|000007f0| 20 66 6f 72 0a 66 69 6e | 64 69 6e 67 20 6f 75 74 | for.fin|ding out|
|00000800| 20 74 68 65 20 72 65 6d | 6f 74 65 20 69 64 65 6e | the rem|ote iden|
|00000810| 74 69 74 79 0a 6f 66 20 | 61 20 63 6f 6e 6e 65 63 |tity.of |a connec|
|00000820| 74 69 6f 6e 20 74 68 72 | 6f 75 67 68 20 74 68 65 |tion thr|ough the|
|00000830| 0a 41 75 74 68 65 6e 74 | 69 63 61 74 69 6f 6e 20 |.Authent|ication |
|00000840| 53 65 72 76 65 72 0a 61 | 73 20 73 70 65 63 69 66 |Server.a|s specif|
|00000850| 69 65 64 20 62 79 20 52 | 46 43 20 39 33 31 2e 0a |ied by R|FC 931..|
|00000860| 55 73 65 20 74 68 65 20 | 2d 6c 61 75 74 68 75 73 |Use the |-lauthus|
|00000870| 65 72 20 6c 6f 61 64 65 | 72 20 6f 70 74 69 6f 6e |er loade|r option|
|00000880| 0a 74 6f 20 63 6f 6d 70 | 69 6c 65 20 61 20 70 72 |.to comp|ile a pr|
|00000890| 6f 67 72 61 6d 20 77 69 | 74 68 20 74 68 69 73 20 |ogram wi|th this |
|000008a0| 6c 69 62 72 61 72 79 2e | 0a 0a 2e 42 20 61 75 74 |library.|...B aut|
|000008b0| 68 5f 78 6c 69 6e 65 28 | 5c 66 49 75 73 65 72 2c |h_xline(|\fIuser,|
|000008c0| 66 64 2c 26 69 6e 72 65 | 6d 6f 74 65 5c 66 42 29 |fd,&inre|mote\fB)|
|000008d0| 0a 72 65 74 75 72 6e 73 | 20 61 20 6c 69 6e 65 20 |.returns| a line |
|000008e0| 6f 66 20 74 68 65 20 66 | 6f 72 6d 20 58 2d 41 75 |of the f|orm X-Au|
|000008f0| 74 68 2d 55 73 65 72 3a | 20 75 73 65 72 20 6f 72 |th-User:| user or|
|00000900| 20 58 2d 46 6f 72 67 65 | 72 79 2d 42 79 3a 20 75 | X-Forge|ry-By: u|
|00000910| 73 65 72 6e 61 6d 65 2c | 0a 64 65 70 65 6e 64 69 |sername,|.dependi|
|00000920| 6e 67 20 75 70 6f 6e 20 | 77 68 61 74 20 74 68 65 |ng upon |what the|
|00000930| 20 68 6f 73 74 20 6f 6e | 20 74 68 65 20 6f 74 68 | host on| the oth|
|00000940| 65 72 20 73 69 64 65 20 | 6f 66 0a 2e 49 20 66 64 |er side |of..I fd|
|00000950| 0a 74 68 69 6e 6b 73 20 | 6f 66 20 74 68 65 20 75 |.thinks |of the u|
|00000960| 73 65 72 2e 0a 54 68 69 | 73 20 69 73 20 70 61 72 |ser..Thi|s is par|
|00000970| 74 69 63 75 6c 61 72 6c | 79 20 61 70 70 72 6f 70 |ticularl|y approp|
|00000980| 72 69 61 74 65 20 66 6f | 72 0a 6d 61 69 6c 20 61 |riate fo|r.mail a|
|00000990| 6e 64 20 6e 65 77 73 20 | 68 65 61 64 65 72 73 2e |nd news |headers.|
|000009a0| 0a 2e 50 50 0a 49 66 20 | 74 68 65 20 72 65 6d 6f |..PP.If |the remo|
|000009b0| 74 65 20 68 6f 73 74 20 | 72 65 70 6f 72 74 73 20 |te host |reports |
|000009c0| 74 68 61 74 0a 2e 49 20 | 75 73 65 72 0a 6f 77 6e |that..I |user.own|
|000009d0| 73 20 74 68 65 20 63 6f | 6e 6e 65 63 74 69 6f 6e |s the co|nnection|
|000009e0| 20 6f 6e 20 74 68 61 74 | 20 73 69 64 65 2c 0a 2e | on that| side,..|
|000009f0| 42 20 61 75 74 68 5f 78 | 6c 69 6e 65 0a 77 69 6c |B auth_x|line.wil|
|00000a00| 6c 20 72 65 74 75 72 6e | 20 58 2d 41 75 74 68 2d |l return| X-Auth-|
|00000a10| 55 73 65 72 3a 20 75 73 | 65 72 2e 0a 49 66 20 74 |User: us|er..If t|
|00000a20| 68 65 20 72 65 6d 6f 74 | 65 20 68 6f 73 74 20 72 |he remot|e host r|
|00000a30| 65 70 6f 72 74 73 20 74 | 68 61 74 20 61 20 64 69 |eports t|hat a di|
|00000a40| 66 66 65 72 65 6e 74 0a | 75 73 65 72 6e 61 6d 65 |fferent.|username|
|00000a50| 0a 6f 77 6e 73 20 74 68 | 65 20 63 6f 6e 6e 65 63 |.owns th|e connec|
|00000a60| 74 69 6f 6e 2c 0a 2e 42 | 20 61 75 74 68 5f 78 6c |tion,..B| auth_xl|
|00000a70| 69 6e 65 0a 77 69 6c 6c | 20 72 65 74 75 72 6e 20 |ine.will| return |
|00000a80| 58 2d 46 6f 72 67 65 72 | 79 2d 42 79 3a 20 75 73 |X-Forger|y-By: us|
|00000a90| 65 72 6e 61 6d 65 2e 0a | 49 66 20 75 73 65 72 20 |ername..|If user |
|00000aa0| 69 73 20 4e 55 4c 4c 2c | 0a 69 74 20 72 65 74 75 |is NULL,|.it retu|
|00000ab0| 72 6e 73 20 58 2d 41 75 | 74 68 2d 55 73 65 72 3a |rns X-Au|th-User:|
|00000ac0| 20 75 73 65 72 6e 61 6d | 65 0a 77 69 74 68 20 74 | usernam|e.with t|
|00000ad0| 68 65 20 75 73 65 72 6e | 61 6d 65 20 72 65 70 6f |he usern|ame repo|
|00000ae0| 72 74 65 64 20 62 79 20 | 74 68 65 20 72 65 6d 6f |rted by |the remo|
|00000af0| 74 65 20 68 6f 73 74 2e | 0a 49 66 20 0a 2e 49 20 |te host.|.If ..I |
|00000b00| 66 64 0a 69 73 20 6e 6f | 74 20 61 20 54 43 50 20 |fd.is no|t a TCP |
|00000b10| 63 6f 6e 6e 65 63 74 69 | 6f 6e 0a 6f 72 20 61 75 |connecti|on.or au|
|00000b20| 74 68 65 6e 74 69 63 61 | 74 69 6f 6e 20 69 73 20 |thentica|tion is |
|00000b30| 69 6d 70 6f 73 73 69 62 | 6c 65 2c 0a 2e 42 20 61 |impossib|le,..B a|
|00000b40| 75 74 68 5f 78 6c 69 6e | 65 0a 72 65 74 75 72 6e |uth_xlin|e.return|
|00000b50| 73 20 4e 55 4c 4c 2c 20 | 73 65 74 74 69 6e 67 20 |s NULL, |setting |
|00000b60| 65 72 72 6e 6f 20 61 70 | 70 72 6f 70 72 69 61 74 |errno ap|propriat|
|00000b70| 65 6c 79 2e 0a 0a 54 68 | 65 20 6c 69 6e 65 20 69 |ely...Th|e line i|
|00000b80| 73 20 6e 6f 74 20 63 72 | 2d 6c 66 20 74 65 72 6d |s not cr|-lf term|
|00000b90| 69 6e 61 74 65 64 2e 0a | 49 74 20 69 73 20 73 74 |inated..|It is st|
|00000ba0| 6f 72 65 64 20 69 6e 20 | 61 20 73 74 61 74 69 63 |ored in |a static|
|00000bb0| 20 61 72 65 61 0a 77 68 | 69 63 68 20 69 73 20 6f | area.wh|ich is o|
|00000bc0| 76 65 72 77 72 69 74 74 | 65 6e 20 6f 6e 20 65 61 |verwritt|en on ea|
|00000bd0| 63 68 20 63 61 6c 6c 20 | 74 6f 0a 2e 42 20 61 75 |ch call |to..B au|
|00000be0| 74 68 5f 78 6c 69 6e 65 | 2e 0a 2e 42 20 61 75 74 |th_xline|...B aut|
|00000bf0| 68 5f 78 6c 69 6e 65 0a | 70 6c 61 63 65 73 20 74 |h_xline.|places t|
|00000c00| 68 65 20 49 6e 74 65 72 | 6e 65 74 20 61 64 64 72 |he Inter|net addr|
|00000c10| 65 73 73 20 6f 66 20 74 | 68 65 20 6f 74 68 65 72 |ess of t|he other|
|00000c20| 20 68 6f 73 74 20 69 6e | 74 6f 0a 2e 49 20 69 6e | host in|to..I in|
|00000c30| 72 65 6d 6f 74 65 2e 0a | 0a 2e 42 20 61 75 74 68 |remote..|..B auth|
|00000c40| 5f 66 64 32 28 5c 66 49 | 66 64 2c 26 69 6e 6c 6f |_fd2(\fI|fd,&inlo|
|00000c50| 63 61 6c 2c 26 69 6e 72 | 65 6d 6f 74 65 2c 26 6c |cal,&inr|emote,&l|
|00000c60| 6f 63 61 6c 2c 26 72 65 | 6d 6f 74 65 5c 66 42 29 |ocal,&re|mote\fB)|
|00000c70| 0a 72 65 74 72 69 65 76 | 65 73 20 61 64 64 72 65 |.retriev|es addre|
|00000c80| 73 73 20 69 6e 66 6f 72 | 6d 61 74 69 6f 6e 20 66 |ss infor|mation f|
|00000c90| 72 6f 6d 20 74 68 65 20 | 63 6f 6e 6e 65 63 74 69 |rom the |connecti|
|00000ca0| 6f 6e 20 69 6e 20 73 6f | 63 6b 65 74 0a 2e 49 20 |on in so|cket..I |
|00000cb0| 66 64 2e 0a 49 74 20 70 | 6c 61 63 65 73 20 74 68 |fd..It p|laces th|
|00000cc0| 65 0a 49 6e 74 65 72 6e | 65 74 20 61 64 64 72 65 |e.Intern|et addre|
|00000cd0| 73 73 65 73 20 6f 66 20 | 74 68 65 20 63 6f 6e 6e |sses of |the conn|
|00000ce0| 65 63 74 69 6f 6e 20 69 | 6e 74 6f 0a 2e 49 20 69 |ection i|nto..I i|
|00000cf0| 6e 6c 6f 63 61 6c 0a 61 | 6e 64 0a 2e 49 20 69 6e |nlocal.a|nd..I in|
|00000d00| 72 65 6d 6f 74 65 0a 61 | 6e 64 20 74 68 65 20 6c |remote.a|nd the l|
|00000d10| 6f 63 61 6c 20 61 6e 64 | 20 72 65 6d 6f 74 65 0a |ocal and| remote.|
|00000d20| 54 43 50 20 70 6f 72 74 | 73 20 69 6e 74 6f 20 0a |TCP port|s into .|
|00000d30| 2e 49 20 6c 6f 63 61 6c | 0a 61 6e 64 20 0a 2e 49 |.I local|.and ..I|
|00000d40| 20 72 65 6d 6f 74 65 2e | 0a 2e 42 20 61 75 74 68 | remote.|..B auth|
|00000d50| 5f 66 64 32 0a 72 65 74 | 75 72 6e 73 20 2d 31 20 |_fd2.ret|urns -1 |
|00000d60| 75 70 6f 6e 20 65 72 72 | 6f 72 2c 20 73 65 74 74 |upon err|or, sett|
|00000d70| 69 6e 67 20 65 72 72 6e | 6f 20 61 70 70 72 6f 70 |ing errn|o approp|
|00000d80| 72 69 61 74 65 6c 79 2e | 0a 0a 2e 42 20 61 75 74 |riately.|...B aut|
|00000d90| 68 5f 74 63 70 75 73 65 | 72 32 28 5c 66 49 69 6e |h_tcpuse|r2(\fIin|
|00000da0| 6c 6f 63 61 6c 2c 69 6e | 72 65 6d 6f 74 65 2c 6c |local,in|remote,l|
|00000db0| 6f 63 61 6c 2c 72 65 6d | 6f 74 65 5c 66 42 29 0a |ocal,rem|ote\fB).|
|00000dc0| 72 65 74 75 72 6e 73 20 | 74 68 65 20 6e 61 6d 65 |returns |the name|
|00000dd0| 20 6f 66 20 74 68 65 20 | 75 73 65 72 20 6f 6e 20 | of the |user on |
|00000de0| 74 68 65 20 6f 74 68 65 | 72 20 65 6e 64 20 6f 66 |the othe|r end of|
|00000df0| 20 74 68 65 20 54 43 50 | 20 63 6f 6e 6e 65 63 74 | the TCP| connect|
|00000e00| 69 6f 6e 0a 62 65 74 77 | 65 65 6e 0a 2e 49 20 72 |ion.betw|een..I r|
|00000e10| 65 6d 6f 74 65 40 69 6e | 72 65 6d 6f 74 65 0a 61 |emote@in|remote.a|
|00000e20| 6e 64 0a 2e 49 20 6c 6f | 63 61 6c 40 69 6e 6c 6f |nd..I lo|cal@inlo|
|00000e30| 63 61 6c 2e 0a 49 66 20 | 61 75 74 68 65 6e 74 69 |cal..If |authenti|
|00000e40| 63 61 74 69 6f 6e 20 69 | 73 20 69 6d 70 6f 73 73 |cation i|s imposs|
|00000e50| 69 62 6c 65 2c 0a 2e 42 | 20 61 75 74 68 5f 74 63 |ible,..B| auth_tc|
|00000e60| 70 75 73 65 72 32 0a 72 | 65 74 75 72 6e 73 0a 4e |puser2.r|eturns.N|
|00000e70| 55 4c 4c 2c 20 73 65 74 | 74 69 6e 67 20 65 72 72 |ULL, set|ting err|
|00000e80| 6e 6f 20 61 70 70 72 6f | 70 72 69 61 74 65 6c 79 |no appro|priately|
|00000e90| 2e 0a 54 68 65 20 75 73 | 65 72 20 6e 61 6d 65 20 |..The us|er name |
|00000ea0| 69 73 20 73 74 6f 72 65 | 64 20 69 6e 20 61 20 73 |is store|d in a s|
|00000eb0| 74 61 74 69 63 20 61 72 | 65 61 0a 77 68 69 63 68 |tatic ar|ea.which|
|00000ec0| 20 69 73 20 6f 76 65 72 | 77 72 69 74 74 65 6e 20 | is over|written |
|00000ed0| 6f 6e 20 65 61 63 68 20 | 63 61 6c 6c 20 74 6f 0a |on each |call to.|
|00000ee0| 2e 42 20 61 75 74 68 5f | 74 63 70 75 73 65 72 32 |.B auth_|tcpuser2|
|00000ef0| 2c 0a 2e 42 20 61 75 74 | 68 5f 74 63 70 75 73 65 |,..B aut|h_tcpuse|
|00000f00| 72 2c 0a 2e 42 20 61 75 | 74 68 5f 73 6f 63 6b 75 |r,..B au|th_socku|
|00000f10| 73 65 72 2c 0a 61 6e 64 | 0a 2e 42 20 61 75 74 68 |ser,.and|..B auth|
|00000f20| 5f 78 6c 69 6e 65 2e 0a | 0a 2e 42 20 5c 66 49 73 |_xline..|..B \fIs|
|00000f30| 5c 66 42 20 3d 20 61 75 | 74 68 5f 74 63 70 73 6f |\fB = au|th_tcpso|
|00000f40| 63 6b 28 5c 66 49 66 64 | 2c 69 6e 6c 6f 63 61 6c |ck(\fIfd|,inlocal|
|00000f50| 2c 69 6e 72 65 6d 6f 74 | 65 5c 66 42 29 0a 73 65 |,inremot|e\fB).se|
|00000f60| 74 73 0a 2e 49 20 73 0a | 74 6f 20 61 20 6e 6f 6e |ts..I s.|to a non|
|00000f70| 2d 62 6c 6f 63 6b 69 6e | 67 20 73 6f 63 6b 65 74 |-blockin|g socket|
|00000f80| 20 77 68 69 63 68 20 69 | 73 20 63 6f 6e 6e 65 63 | which i|s connec|
|00000f90| 74 69 6e 67 20 74 6f 20 | 74 68 65 20 41 75 74 68 |ting to |the Auth|
|00000fa0| 65 6e 74 69 63 61 74 69 | 6f 6e 0a 53 65 72 76 65 |enticati|on.Serve|
|00000fb0| 72 20 61 74 0a 2e 49 20 | 69 6e 72 65 6d 6f 74 65 |r at..I |inremote|
|00000fc0| 2e 0a 49 74 20 72 65 74 | 75 72 6e 73 20 2d 31 20 |..It ret|urns -1 |
|00000fd0| 6f 6e 20 65 72 72 6f 72 | 2c 20 73 65 74 74 69 6e |on error|, settin|
|00000fe0| 67 20 65 72 72 6e 6f 20 | 61 70 70 72 6f 70 72 69 |g errno |appropri|
|00000ff0| 61 74 65 6c 79 2e 0a 2e | 42 20 61 75 74 68 5f 73 |ately...|B auth_s|
|00001000| 6f 63 6b 75 73 65 72 28 | 5c 66 49 73 2c 6c 6f 63 |ockuser(|\fIs,loc|
|00001010| 61 6c 2c 72 65 6d 6f 74 | 65 5c 66 42 29 0a 6d 61 |al,remot|e\fB).ma|
|00001020| 6b 65 73 20 73 75 72 65 | 20 74 68 61 74 20 74 68 |kes sure| that th|
|00001030| 65 20 73 6f 63 6b 65 74 | 20 68 61 73 20 63 6f 6e |e socket| has con|
|00001040| 6e 65 63 74 65 64 20 61 | 6e 64 0a 74 68 65 6e 20 |nected a|nd.then |
|00001050| 64 6f 65 73 20 74 68 65 | 20 73 61 6d 65 20 6a 6f |does the| same jo|
|00001060| 62 20 61 73 0a 2e 42 20 | 61 75 74 68 5f 74 63 70 |b as..B |auth_tcp|
|00001070| 75 73 65 72 32 2c 0a 72 | 65 74 75 72 6e 69 6e 67 |user2,.r|eturning|
|00001080| 20 74 68 65 20 6e 61 6d | 65 20 6f 66 20 74 68 65 | the nam|e of the|
|00001090| 20 75 73 65 72 20 6f 6e | 20 74 68 65 20 6f 74 68 | user on| the oth|
|000010a0| 65 72 20 65 6e 64 20 6f | 66 20 74 68 65 20 54 43 |er end o|f the TC|
|000010b0| 50 20 63 6f 6e 6e 65 63 | 74 69 6f 6e 0a 62 65 74 |P connec|tion.bet|
|000010c0| 77 65 65 6e 0a 2e 49 20 | 72 65 6d 6f 74 65 40 69 |ween..I |remote@i|
|000010d0| 6e 72 65 6d 6f 74 65 0a | 61 6e 64 0a 2e 49 20 6c |nremote.|and..I l|
|000010e0| 6f 63 61 6c 40 69 6e 6c | 6f 63 61 6c 2c 0a 6f 72 |ocal@inl|ocal,.or|
|000010f0| 20 4e 55 4c 4c 20 28 77 | 69 74 68 20 65 72 72 6e | NULL (w|ith errn|
|00001100| 6f 20 73 65 74 29 20 69 | 66 20 61 75 74 68 65 6e |o set) i|f authen|
|00001110| 74 69 63 61 74 69 6f 6e | 20 69 73 20 6e 6f 74 20 |tication| is not |
|00001120| 70 6f 73 73 69 62 6c 65 | 2e 0a 2e 49 20 73 0a 69 |possible|...I s.i|
|00001130| 73 20 63 6c 6f 73 65 64 | 20 62 79 0a 2e 42 20 61 |s closed| by..B a|
|00001140| 75 74 68 5f 73 6f 63 6b | 75 73 65 72 2e 0a 54 68 |uth_sock|user..Th|
|00001150| 65 20 61 64 76 61 6e 74 | 61 67 65 20 6f 66 0a 75 |e advant|age of.u|
|00001160| 73 69 6e 67 0a 2e 42 20 | 61 75 74 68 5f 74 63 70 |sing..B |auth_tcp|
|00001170| 73 6f 63 6b 0a 61 6e 64 | 0a 2e 42 20 61 75 74 68 |sock.and|..B auth|
|00001180| 5f 73 6f 63 6b 75 73 65 | 72 0a 69 6e 73 74 65 61 |_sockuse|r.instea|
|00001190| 64 20 6f 66 0a 2e 42 20 | 61 75 74 68 5f 74 63 70 |d of..B |auth_tcp|
|000011a0| 75 73 65 72 32 0a 69 73 | 20 74 68 61 74 20 79 6f |user2.is| that yo|
|000011b0| 75 20 63 61 6e 20 70 65 | 72 66 6f 72 6d 20 6f 74 |u can pe|rform ot|
|000011c0| 68 65 72 20 61 63 74 69 | 6f 6e 73 20 77 68 69 6c |her acti|ons whil|
|000011d0| 65 20 77 61 69 74 69 6e | 67 20 66 6f 72 20 74 68 |e waitin|g for th|
|000011e0| 65 0a 61 75 74 68 65 6e | 74 69 63 61 74 69 6f 6e |e.authen|tication|
|000011f0| 20 72 65 71 75 65 73 74 | 20 74 6f 20 63 6f 6d 70 | request| to comp|
|00001200| 6c 65 74 65 2e 0a 59 6f | 75 20 63 61 6e 20 73 65 |lete..Yo|u can se|
|00001210| 6c 65 63 74 0a 2e 49 20 | 73 0a 66 6f 72 20 77 72 |lect..I |s.for wr|
|00001220| 69 74 69 6e 67 0a 74 6f | 20 73 65 65 20 69 66 20 |iting.to| see if |
|00001230| 69 74 20 69 73 20 72 65 | 61 64 79 20 66 6f 72 0a |it is re|ady for.|
|00001240| 2e 42 20 61 75 74 68 5f | 73 6f 63 6b 75 73 65 72 |.B auth_|sockuser|
|00001250| 0a 79 65 74 2e 0a 0a 2e | 42 20 61 75 74 68 5f 74 |.yet....|B auth_t|
|00001260| 63 70 75 73 65 72 33 28 | 5c 66 49 69 6e 6c 6f 63 |cpuser3(|\fIinloc|
|00001270| 61 6c 2c 69 6e 72 65 6d | 6f 74 65 2c 6c 6f 63 61 |al,inrem|ote,loca|
|00001280| 6c 2c 72 65 6d 6f 74 65 | 2c 63 74 69 6d 65 6f 75 |l,remote|,ctimeou|
|00001290| 74 5c 66 42 29 0a 69 73 | 20 6c 69 6b 65 0a 2e 42 |t\fB).is| like..B|
|000012a0| 20 61 75 74 68 5f 74 63 | 70 75 73 65 72 32 0a 62 | auth_tc|puser2.b|
|000012b0| 75 74 0a 72 65 74 75 72 | 6e 73 0a 4e 55 4c 4c 20 |ut.retur|ns.NULL |
|000012c0| 77 69 74 68 20 65 72 72 | 6e 6f 20 73 65 74 20 74 |with err|no set t|
|000012d0| 6f 20 45 54 49 4d 45 44 | 4f 55 54 0a 69 66 20 74 |o ETIMED|OUT.if t|
|000012e0| 68 65 20 61 75 74 68 65 | 6e 74 69 63 61 74 69 6f |he authe|nticatio|
|000012f0| 6e 20 72 65 71 75 65 73 | 74 20 68 61 73 20 6e 6f |n reques|t has no|
|00001300| 74 20 62 65 65 6e 20 61 | 63 63 65 70 74 65 64 20 |t been a|ccepted |
|00001310| 6f 72 20 72 65 66 75 73 | 65 64 20 61 66 74 65 72 |or refus|ed after|
|00001320| 0a 2e 49 20 63 74 69 6d | 65 6f 75 74 0a 73 65 63 |..I ctim|eout.sec|
|00001330| 6f 6e 64 73 2e 0a 0a 2e | 42 20 61 75 74 68 5f 74 |onds....|B auth_t|
|00001340| 63 70 75 73 65 72 34 28 | 5c 66 49 69 6e 6c 6f 63 |cpuser4(|\fIinloc|
|00001350| 61 6c 2c 69 6e 72 65 6d | 6f 74 65 2c 6c 6f 63 61 |al,inrem|ote,loca|
|00001360| 6c 2c 72 65 6d 6f 74 65 | 2c 63 74 69 6d 65 6f 75 |l,remote|,ctimeou|
|00001370| 74 2c 72 74 69 6d 65 6f | 75 74 5c 66 42 29 0a 69 |t,rtimeo|ut\fB).i|
|00001380| 73 20 6c 69 6b 65 0a 2e | 42 20 61 75 74 68 5f 74 |s like..|B auth_t|
|00001390| 63 70 75 73 65 72 33 0a | 62 75 74 20 72 65 74 75 |cpuser3.|but retu|
|000013a0| 72 6e 73 0a 4e 55 4c 4c | 20 77 69 74 68 20 65 72 |rns.NULL| with er|
|000013b0| 72 6e 6f 20 73 65 74 20 | 74 6f 20 45 54 49 4d 45 |rno set |to ETIME|
|000013c0| 44 4f 55 54 0a 69 66 20 | 74 68 65 20 72 65 70 6c |DOUT.if |the repl|
|000013d0| 79 20 74 6f 20 74 68 65 | 20 61 75 74 68 65 6e 74 |y to the| authent|
|000013e0| 69 63 61 74 69 6f 6e 20 | 72 65 71 75 65 73 74 20 |ication |request |
|000013f0| 69 73 20 62 65 69 6e 67 | 20 73 65 6e 74 20 73 6c |is being| sent sl|
|00001400| 6f 77 65 72 20 74 68 61 | 6e 0a 2e 49 20 72 74 69 |ower tha|n..I rti|
|00001410| 6d 65 6f 75 74 0a 73 65 | 63 6f 6e 64 73 2f 63 68 |meout.se|conds/ch|
|00001420| 61 72 61 63 74 65 72 2e | 0a 0a 2e 42 20 61 75 74 |aracter.|...B aut|
|00001430| 68 5f 66 64 28 5c 66 49 | 66 64 2c 26 69 6e 72 65 |h_fd(\fI|fd,&inre|
|00001440| 6d 6f 74 65 2c 26 6c 6f | 63 61 6c 2c 26 72 65 6d |mote,&lo|cal,&rem|
|00001450| 6f 74 65 5c 66 42 29 0a | 69 73 20 74 68 65 20 73 |ote\fB).|is the s|
|00001460| 61 6d 65 20 61 73 0a 2e | 42 20 61 75 74 68 5f 66 |ame as..|B auth_f|
|00001470| 64 32 0a 62 75 74 20 74 | 68 72 6f 77 73 20 61 77 |d2.but t|hrows aw|
|00001480| 61 79 20 74 68 65 0a 2e | 49 20 69 6e 6c 6f 63 61 |ay the..|I inloca|
|00001490| 6c 0a 69 6e 66 6f 72 6d | 61 74 69 6f 6e 2e 0a 2e |l.inform|ation...|
|000014a0| 42 20 61 75 74 68 5f 74 | 63 70 75 73 65 72 28 5c |B auth_t|cpuser(\|
|000014b0| 66 49 69 6e 72 65 6d 6f | 74 65 2c 6c 6f 63 61 6c |fIinremo|te,local|
|000014c0| 2c 72 65 6d 6f 74 65 5c | 66 42 29 0a 69 73 20 74 |,remote\|fB).is t|
|000014d0| 68 65 20 73 61 6d 65 20 | 61 73 0a 2e 42 20 61 75 |he same |as..B au|
|000014e0| 74 68 5f 74 63 70 75 73 | 65 72 32 0a 62 75 74 20 |th_tcpus|er2.but |
|000014f0| 6d 61 79 20 6e 6f 74 20 | 62 69 6e 64 20 74 6f 20 |may not |bind to |
|00001500| 74 68 65 20 70 72 6f 70 | 65 72 20 6c 6f 63 61 6c |the prop|er local|
|00001510| 20 61 64 64 72 65 73 73 | 20 6f 6e 0a 68 6f 73 74 | address| on.host|
|00001520| 73 20 77 69 74 68 20 6d | 75 6c 74 69 70 6c 65 20 |s with m|ultiple |
|00001530| 49 50 20 61 64 64 72 65 | 73 73 65 73 2e 0a 54 68 |IP addre|sses..Th|
|00001540| 65 73 65 20 66 75 6e 63 | 74 69 6f 6e 73 20 64 6f |ese func|tions do|
|00001550| 20 6e 6f 74 20 70 65 72 | 66 6f 72 6d 20 70 72 6f | not per|form pro|
|00001560| 70 65 72 6c 79 20 6f 6e | 20 6d 75 6c 74 69 68 6f |perly on| multiho|
|00001570| 6d 65 64 0a 68 6f 73 74 | 73 20 61 6e 64 20 73 68 |med.host|s and sh|
|00001580| 6f 75 6c 64 20 6e 6f 74 | 20 62 65 20 75 73 65 64 |ould not| be used|
|00001590| 2e 0a 54 68 65 79 20 61 | 72 65 20 70 72 6f 76 69 |..They a|re provi|
|000015a0| 64 65 64 20 6f 6e 6c 79 | 20 66 6f 72 20 62 61 63 |ded only| for bac|
|000015b0| 6b 77 61 72 64 73 20 63 | 6f 6d 70 61 74 69 62 69 |kwards c|ompatibi|
|000015c0| 6c 69 74 79 2e 0a 0a 54 | 68 65 20 61 75 74 68 65 |lity...T|he authe|
|000015d0| 6e 74 69 63 61 74 69 6f | 6e 20 72 6f 75 74 69 6e |nticatio|n routin|
|000015e0| 65 73 20 63 68 65 63 6b | 20 77 69 74 68 20 74 68 |es check| with th|
|000015f0| 65 0a 72 65 6d 6f 74 65 | 20 41 75 74 68 65 6e 74 |e.remote| Authent|
|00001600| 69 63 61 74 69 6f 6e 20 | 53 65 72 76 65 72 20 6f |ication |Server o|
|00001610| 6e 20 70 6f 72 74 0a 2e | 42 20 61 75 74 68 5f 74 |n port..|B auth_t|
|00001620| 63 70 70 6f 72 74 2c 0a | 77 68 69 63 68 20 64 65 |cpport,.|which de|
|00001630| 66 61 75 6c 74 73 20 74 | 6f 20 31 31 33 0a 61 73 |faults t|o 113.as|
|00001640| 20 73 70 65 63 69 66 69 | 65 64 20 62 79 20 52 46 | specifi|ed by RF|
|00001650| 43 20 39 33 31 2e 0a 59 | 6f 75 20 63 61 6e 20 73 |C 931..Y|ou can s|
|00001660| 65 74 0a 2e 42 20 61 75 | 74 68 5f 74 63 70 70 6f |et..B au|th_tcppo|
|00001670| 72 74 0a 74 6f 20 6f 74 | 68 65 72 20 76 61 6c 75 |rt.to ot|her valu|
|00001680| 65 73 0a 66 6f 72 20 6e | 6f 6e 73 74 61 6e 64 61 |es.for n|onstanda|
|00001690| 72 64 20 69 6d 70 6c 65 | 6d 65 6e 74 61 74 69 6f |rd imple|mentatio|
|000016a0| 6e 73 2e 0a 2e 53 48 20 | 52 45 53 54 52 49 43 54 |ns...SH |RESTRICT|
|000016b0| 49 4f 4e 53 0a 2e 42 20 | 61 75 74 68 75 73 65 72 |IONS..B |authuser|
|000016c0| 0a 64 6f 65 73 20 6e 6f | 20 62 61 63 6b 73 6c 61 |.does no| backsla|
|000016d0| 73 68 20 69 6e 74 65 72 | 70 72 65 74 61 74 69 6f |sh inter|pretatio|
|000016e0| 6e 0a 75 70 6f 6e 20 74 | 68 65 20 72 65 6d 6f 74 |n.upon t|he remot|
|000016f0| 65 20 75 73 65 72 20 6e | 61 6d 65 2e 0a 54 68 69 |e user n|ame..Thi|
|00001700| 73 20 69 73 20 63 6f 6e | 66 6f 72 6d 61 6e 63 65 |s is con|formance|
|00001710| 20 77 69 74 68 20 74 68 | 65 20 70 72 6f 70 6f 73 | with th|e propos|
|00001720| 65 64 20 72 65 76 69 73 | 69 6f 6e 20 74 6f 0a 52 |ed revis|ion to.R|
|00001730| 46 43 20 39 33 31 2e 0a | 0a 2e 42 20 61 75 74 68 |FC 931..|..B auth|
|00001740| 75 73 65 72 0a 64 6f 65 | 73 20 6e 6f 74 20 75 73 |user.doe|s not us|
|00001750| 65 20 74 68 65 20 6f 70 | 65 72 61 74 69 6e 67 20 |e the op|erating |
|00001760| 73 79 73 74 65 6d 20 74 | 79 70 65 0a 69 6e 66 6f |system t|ype.info|
|00001770| 72 6d 61 74 69 6f 6e 20 | 70 72 6f 76 69 64 65 64 |rmation |provided|
|00001780| 20 62 79 20 74 68 65 20 | 41 75 74 68 65 6e 74 69 | by the |Authenti|
|00001790| 63 61 74 69 6f 6e 20 53 | 65 72 76 65 72 2e 0a 2e |cation S|erver...|
|000017a0| 53 48 20 56 45 52 53 49 | 4f 4e 0a 61 75 74 68 75 |SH VERSI|ON.authu|
|000017b0| 73 65 72 20 76 65 72 73 | 69 6f 6e 20 34 2e 30 2c |ser vers|ion 4.0,|
|000017c0| 20 46 65 62 72 75 61 72 | 79 20 39 2c 20 31 39 39 | Februar|y 9, 199|
|000017d0| 32 2e 0a 2e 53 48 20 41 | 55 54 48 4f 52 0a 50 6c |2...SH A|UTHOR.Pl|
|000017e0| 61 63 65 64 20 69 6e 74 | 6f 20 74 68 65 20 70 75 |aced int|o the pu|
|000017f0| 62 6c 69 63 20 64 6f 6d | 61 69 6e 20 62 79 20 44 |blic dom|ain by D|
|00001800| 61 6e 69 65 6c 20 4a 2e | 20 42 65 72 6e 73 74 65 |aniel J.| Bernste|
|00001810| 69 6e 2e 0a 2e 53 48 20 | 52 45 46 45 52 45 4e 43 |in...SH |REFERENC|
|00001820| 45 53 0a 54 68 65 20 61 | 75 74 68 65 6e 74 69 63 |ES.The a|uthentic|
|00001830| 61 74 69 6f 6e 20 73 65 | 72 76 65 72 20 69 73 20 |ation se|rver is |
|00001840| 6d 6f 72 65 20 73 65 63 | 75 72 65 20 74 68 61 6e |more sec|ure than|
|00001850| 20 70 61 73 73 77 6f 72 | 64 73 0a 69 6e 20 73 6f | passwor|ds.in so|
|00001860| 6d 65 20 77 61 79 73 2c | 20 62 75 74 20 6c 65 73 |me ways,| but les|
|00001870| 73 20 73 65 63 75 72 65 | 20 74 68 61 6e 20 70 61 |s secure| than pa|
|00001880| 73 73 77 6f 72 64 73 20 | 69 6e 20 6d 61 6e 79 20 |sswords |in many |
|00001890| 77 61 79 73 2e 0a 28 49 | 74 27 73 20 63 65 72 74 |ways..(I|t's cert|
|000018a0| 61 69 6e 6c 79 20 62 65 | 74 74 65 72 20 74 68 61 |ainly be|tter tha|
|000018b0| 6e 20 6e 6f 20 70 61 73 | 73 77 6f 72 64 20 61 74 |n no pas|sword at|
|000018c0| 20 61 6c 6c 2d 2d 2d 65 | 2e 67 2e 2c 20 66 6f 72 | all---e|.g., for|
|000018d0| 0a 6d 61 69 6c 20 6f 72 | 20 6e 65 77 73 2e 29 0a |.mail or| news.).|
|000018e0| 49 74 20 69 73 20 6e 6f | 74 20 74 68 65 20 66 69 |It is no|t the fi|
|000018f0| 6e 61 6c 20 73 6f 6c 75 | 74 69 6f 6e 2e 0a 46 6f |nal solu|tion..Fo|
|00001900| 72 20 61 6e 20 65 78 63 | 65 6c 6c 65 6e 74 20 64 |r an exc|ellent d|
|00001910| 69 73 63 75 73 73 69 6f | 6e 20 6f 66 20 73 65 63 |iscussio|n of sec|
|00001920| 75 72 69 74 79 20 70 72 | 6f 62 6c 65 6d 73 20 77 |urity pr|oblems w|
|00001930| 69 74 68 69 6e 0a 74 68 | 65 20 54 43 50 2f 49 50 |ithin.th|e TCP/IP|
|00001940| 20 70 72 6f 74 6f 63 6f | 6c 20 73 75 69 74 65 2c | protoco|l suite,|
|00001950| 20 73 65 65 0a 53 74 65 | 76 65 20 42 65 6c 6c 6f | see.Ste|ve Bello|
|00001960| 76 69 6e 27 73 20 61 72 | 74 69 63 6c 65 0a 60 60 |vin's ar|ticle.``|
|00001970| 53 65 63 75 72 69 74 79 | 20 50 72 6f 62 6c 65 6d |Security| Problem|
|00001980| 73 20 69 6e 20 74 68 65 | 20 54 43 50 2f 49 50 20 |s in the| TCP/IP |
|00001990| 50 72 6f 74 6f 63 6f 6c | 20 53 75 69 74 65 2e 27 |Protocol| Suite.'|
|000019a0| 27 0a 2e 53 48 20 22 53 | 45 45 20 41 4c 53 4f 22 |'..SH "S|EE ALSO"|
|000019b0| 0a 74 63 70 63 6c 69 65 | 6e 74 28 31 29 2c 0a 74 |.tcpclie|nt(1),.t|
|000019c0| 63 70 73 65 72 76 65 72 | 28 31 29 2c 0a 67 65 74 |cpserver|(1),.get|
|000019d0| 70 65 65 72 6e 61 6d 65 | 28 33 29 2c 0a 67 65 74 |peername|(3),.get|
|000019e0| 73 6f 63 6b 6e 61 6d 65 | 28 33 29 2c 0a 74 63 70 |sockname|(3),.tcp|
|000019f0| 28 34 29 2c 0a 61 75 74 | 68 64 28 38 29 0a 00 00 |(4),.aut|hd(8)...|
|00001a00| 6c 69 62 61 75 74 68 2d | 34 2e 30 2d 70 35 2f 61 |libauth-|4.0-p5/a|
|00001a10| 75 74 68 75 73 65 72 2e | 68 00 00 00 00 00 00 00 |uthuser.|h.......|
|00001a20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001a30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001a40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001a50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001a60| 00 00 00 00 20 20 20 36 | 34 34 20 00 20 20 20 31 |.... 6|44 . 1|
|00001a70| 37 31 20 00 20 20 20 20 | 33 36 20 00 20 20 20 20 |71 . |36 . |
|00001a80| 20 20 20 20 36 32 30 20 | 20 35 33 33 33 34 34 31 | 620 | 5333441|
|00001a90| 34 31 35 20 20 31 30 33 | 35 31 00 20 00 00 00 00 |415 103|51. ....|
|00001aa0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ab0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ac0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ad0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ae0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001af0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001b00| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001b10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001b20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001b30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001b40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001b50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001b60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001b70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001b80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001b90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ba0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001bb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001bc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001bd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001be0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001bf0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001c00| 23 69 66 6e 64 65 66 20 | 41 55 54 48 55 53 45 52 |#ifndef |AUTHUSER|
|00001c10| 5f 48 0a 23 64 65 66 69 | 6e 65 20 41 55 54 48 55 |_H.#defi|ne AUTHU|
|00001c20| 53 45 52 5f 48 0a 0a 65 | 78 74 65 72 6e 20 75 6e |SER_H..e|xtern un|
|00001c30| 73 69 67 6e 65 64 20 73 | 68 6f 72 74 20 61 75 74 |signed s|hort aut|
|00001c40| 68 5f 74 63 70 70 6f 72 | 74 3b 0a 65 78 74 65 72 |h_tcppor|t;.exter|
|00001c50| 6e 20 69 6e 74 20 20 20 | 20 20 20 20 20 20 20 20 |n int | |
|00001c60| 20 61 75 74 68 5f 72 74 | 69 6d 65 6f 75 74 3b 0a | auth_rt|imeout;.|
|00001c70| 0a 65 78 74 65 72 6e 20 | 63 68 61 72 20 2a 61 75 |.extern |char *au|
|00001c80| 74 68 5f 78 6c 69 6e 65 | 28 29 3b 0a 65 78 74 65 |th_xline|();.exte|
|00001c90| 72 6e 20 69 6e 74 20 61 | 75 74 68 5f 66 64 28 29 |rn int a|uth_fd()|
|00001ca0| 3b 0a 65 78 74 65 72 6e | 20 69 6e 74 20 61 75 74 |;.extern| int aut|
|00001cb0| 68 5f 66 64 32 28 29 3b | 0a 65 78 74 65 72 6e 20 |h_fd2();|.extern |
|00001cc0| 69 6e 74 20 61 75 74 68 | 5f 74 63 70 73 6f 63 6b |int auth|_tcpsock|
|00001cd0| 28 29 3b 0a 65 78 74 65 | 72 6e 20 63 68 61 72 20 |();.exte|rn char |
|00001ce0| 2a 61 75 74 68 5f 74 63 | 70 75 73 65 72 28 29 3b |*auth_tc|puser();|
|00001cf0| 0a 65 78 74 65 72 6e 20 | 63 68 61 72 20 2a 61 75 |.extern |char *au|
|00001d00| 74 68 5f 74 63 70 75 73 | 65 72 32 28 29 3b 0a 65 |th_tcpus|er2();.e|
|00001d10| 78 74 65 72 6e 20 63 68 | 61 72 20 2a 61 75 74 68 |xtern ch|ar *auth|
|00001d20| 5f 74 63 70 75 73 65 72 | 33 28 29 3b 0a 65 78 74 |_tcpuser|3();.ext|
|00001d30| 65 72 6e 20 63 68 61 72 | 20 2a 61 75 74 68 5f 74 |ern char| *auth_t|
|00001d40| 63 70 75 73 65 72 34 28 | 29 3b 0a 65 78 74 65 72 |cpuser4(|);.exter|
|00001d50| 6e 20 63 68 61 72 20 2a | 61 75 74 68 5f 73 6f 63 |n char *|auth_soc|
|00001d60| 6b 75 73 65 72 28 29 3b | 0a 65 78 74 65 72 6e 20 |kuser();|.extern |
|00001d70| 63 68 61 72 20 2a 61 75 | 74 68 5f 73 6f 63 6b 75 |char *au|th_socku|
|00001d80| 73 65 72 32 28 29 3b 0a | 0a 23 65 6e 64 69 66 0a |ser2();.|.#endif.|
|00001d90| 20 2a 5c 66 42 61 75 74 | 68 5f 74 63 70 75 73 65 | *\fBaut|h_tcpuse|
|00001da0| 72 28 5c 66 49 69 6e 72 | 65 6d 6f 74 65 2c 6c 6f |r(\fIinr|emote,lo|
|00001db0| 63 61 6c 2c 72 65 6d 6f | 74 65 5c 66 42 29 5c 66 |cal,remo|te\fB)\f|
|00001dc0| 52 3b 0a 2e 62 72 0a 63 | 68 61 72 20 2a 5c 66 42 |R;..br.c|har *\fB|
|00001dd0| 61 75 74 68 5f 74 63 70 | 75 73 65 72 32 28 5c 66 |auth_tcp|user2(\f|
|00001de0| 49 69 6e 6c 6f 63 61 6c | 2c 69 6e 72 65 6d 6f 74 |Iinlocal|,inremot|
|00001df0| 65 2c 6c 6f 63 61 6c 2c | 72 65 6d 6f 74 65 5c 66 |e,local,|remote\f|
|00001e00| 6c 69 62 61 75 74 68 2d | 34 2e 30 2d 70 35 2f 61 |libauth-|4.0-p5/a|
|00001e10| 75 74 68 75 73 65 72 2e | 63 00 00 00 00 00 00 00 |uthuser.|c.......|
|00001e20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001e30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001e40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001e50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001e60| 00 00 00 00 20 20 20 36 | 34 34 20 00 20 20 20 31 |.... 6|44 . 1|
|00001e70| 37 31 20 00 20 20 20 20 | 33 36 20 00 20 20 20 20 |71 . |36 . |
|00001e80| 20 20 32 30 32 34 31 20 | 20 35 34 30 30 37 33 32 | 20241 | 5400732|
|00001e90| 34 36 35 20 20 31 30 34 | 31 30 00 20 00 00 00 00 |465 104|10. ....|
|00001ea0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001eb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ec0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ed0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ee0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ef0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001f00| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001f10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001f20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001f30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001f40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001f50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001f60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001f70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001f80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001f90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001fa0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001fb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001fc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001fd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001fe0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ff0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002000| 2f 2a 0a 20 2a 2a 20 61 | 75 74 68 75 73 65 72 2e |/*. ** a|uthuser.|
|00002010| 63 0a 20 2a 2a 0a 20 2a | 2a 20 32 2f 32 2f 39 33 |c. **. *|* 2/2/93|
|00002020| 3a 20 41 64 64 65 64 20 | 61 75 74 68 5f 73 65 74 |: Added |auth_set|
|00002030| 72 65 61 64 74 69 6d 65 | 6f 75 74 28 29 20 63 61 |readtime|out() ca|
|00002040| 6c 6c 2e 0a 20 2a 2a 20 | 37 2f 32 31 2f 39 32 3a |ll.. ** |7/21/92:|
|00002050| 20 46 69 78 65 64 20 53 | 49 47 50 49 50 45 20 62 | Fixed S|IGPIPE b|
|00002060| 75 67 20 69 6e 20 61 75 | 74 68 5f 74 63 70 75 73 |ug in au|th_tcpus|
|00002070| 65 72 33 28 29 2e 20 3c | 70 65 6e 40 6c 79 73 61 |er3(). <|pen@lysa|
|00002080| 74 6f 72 2e 6c 69 75 2e | 73 65 3e 0a 20 2a 2a 20 |tor.liu.|se>. ** |
|00002090| 32 2f 39 2f 39 32 3a 20 | 61 75 74 68 75 73 65 72 |2/9/92: |authuser|
|000020a0| 20 34 2e 30 2e 20 50 75 | 62 6c 69 63 20 64 6f 6d | 4.0. Pu|blic dom|
|000020b0| 61 69 6e 2e 0a 20 2a 2a | 20 32 2f 39 2f 39 32 3a |ain.. **| 2/9/92:|
|000020c0| 20 61 64 64 65 64 20 62 | 75 6e 63 68 65 73 20 6f | added b|unches o|
|000020d0| 66 20 7a 65 72 6f 69 6e | 67 20 6a 75 73 74 20 69 |f zeroin|g just i|
|000020e0| 6e 20 63 61 73 65 2e 0a | 20 2a 2a 20 32 2f 39 2f |n case..| ** 2/9/|
|000020f0| 39 32 3a 20 61 64 64 65 | 64 20 61 75 74 68 5f 74 |92: adde|d auth_t|
|00002100| 63 70 75 73 65 72 33 2e | 20 75 73 65 73 20 62 73 |cpuser3.| uses bs|
|00002110| 64 20 34 2e 33 20 73 65 | 6c 65 63 74 20 69 6e 74 |d 4.3 se|lect int|
|00002120| 65 72 66 61 63 65 2e 0a | 20 2a 2a 20 32 2f 39 2f |erface..| ** 2/9/|
|00002130| 39 32 3a 20 61 64 64 65 | 64 20 61 75 74 68 5f 74 |92: adde|d auth_t|
|00002140| 63 70 73 6f 63 6b 2c 20 | 61 75 74 68 5f 73 6f 63 |cpsock, |auth_soc|
|00002150| 6b 75 73 65 72 2e 0a 20 | 2a 2a 20 32 2f 39 2f 39 |kuser.. |** 2/9/9|
|00002160| 32 3a 20 61 64 64 65 64 | 20 61 75 74 68 5f 66 64 |2: added| auth_fd|
|00002170| 32 2c 20 61 75 74 68 5f | 74 63 70 75 73 65 72 32 |2, auth_|tcpuser2|
|00002180| 2c 20 73 69 6d 70 6c 69 | 66 69 65 64 20 73 6f 6d |, simpli|fied som|
|00002190| 65 20 6f 66 20 74 68 65 | 20 63 6f 64 65 2e 0a 20 |e of the| code.. |
|000021a0| 2a 2a 20 31 32 2f 32 37 | 2f 39 31 3a 20 66 69 78 |** 12/27|/91: fix|
|000021b0| 65 64 20 75 70 20 75 73 | 65 72 63 6d 70 20 74 6f |ed up us|ercmp to|
|000021c0| 20 64 65 61 6c 20 77 69 | 74 68 20 72 65 73 74 72 | deal wi|th restr|
|000021d0| 69 63 74 65 64 20 74 6f | 6c 6f 77 65 72 20 58 58 |icted to|lower XX|
|000021e0| 58 0a 20 2a 2a 20 35 2f | 36 2f 39 31 20 44 4a 42 |X. ** 5/|6/91 DJB|
|000021f0| 20 62 61 73 65 6c 69 6e | 65 20 61 75 74 68 75 73 | baselin|e authus|
|00002200| 65 72 20 33 2e 31 2e 20 | 50 75 62 6c 69 63 20 64 |er 3.1. |Public d|
|00002210| 6f 6d 61 69 6e 2e 0a 20 | 2a 2f 0a 0a 23 69 6e 63 |omain.. |*/..#inc|
|00002220| 6c 75 64 65 20 3c 73 74 | 64 69 6f 2e 68 3e 0a 23 |lude <st|dio.h>.#|
|00002230| 69 6e 63 6c 75 64 65 20 | 3c 73 69 67 6e 61 6c 2e |include |<signal.|
|00002240| 68 3e 0a 23 69 6e 63 6c | 75 64 65 20 3c 73 79 73 |h>.#incl|ude <sys|
|00002250| 2f 74 79 70 65 73 2e 68 | 3e 0a 23 69 6e 63 6c 75 |/types.h|>.#inclu|
|00002260| 64 65 20 3c 73 79 73 2f | 74 69 6d 65 2e 68 3e 0a |de <sys/|time.h>.|
|00002270| 23 69 6e 63 6c 75 64 65 | 20 3c 73 79 73 2f 66 69 |#include| <sys/fi|
|00002280| 6c 65 2e 68 3e 0a 23 69 | 6e 63 6c 75 64 65 20 3c |le.h>.#i|nclude <|
|00002290| 66 63 6e 74 6c 2e 68 3e | 20 2f 2a 58 58 58 2a 2f |fcntl.h>| /*XXX*/|
|000022a0| 0a 23 69 6e 63 6c 75 64 | 65 20 3c 73 79 73 2f 73 |.#includ|e <sys/s|
|000022b0| 6f 63 6b 65 74 2e 68 3e | 0a 23 69 6e 63 6c 75 64 |ocket.h>|.#includ|
|000022c0| 65 20 3c 6e 65 74 69 6e | 65 74 2f 69 6e 2e 68 3e |e <netin|et/in.h>|
|000022d0| 0a 23 69 6e 63 6c 75 64 | 65 20 3c 63 74 79 70 65 |.#includ|e <ctype|
|000022e0| 2e 68 3e 0a 23 69 6e 63 | 6c 75 64 65 20 3c 65 72 |.h>.#inc|lude <er|
|000022f0| 72 6e 6f 2e 68 3e 0a 65 | 78 74 65 72 6e 20 69 6e |rno.h>.e|xtern in|
|00002300| 74 20 65 72 72 6e 6f 3b | 0a 23 69 6e 63 6c 75 64 |t errno;|.#includ|
|00002310| 65 20 22 61 75 74 68 75 | 73 65 72 2e 68 22 0a 0a |e "authu|ser.h"..|
|00002320| 23 69 66 6e 64 65 66 20 | 46 4e 44 45 4c 41 59 0a |#ifndef |FNDELAY.|
|00002330| 23 20 20 64 65 66 69 6e | 65 20 46 4e 44 45 4c 41 |# defin|e FNDELA|
|00002340| 59 20 4f 5f 4e 44 45 4c | 41 59 0a 23 65 6e 64 69 |Y O_NDEL|AY.#endi|
|00002350| 66 0a 0a 75 6e 73 69 67 | 6e 65 64 20 73 68 6f 72 |f..unsig|ned shor|
|00002360| 74 20 61 75 74 68 5f 74 | 63 70 70 6f 72 74 20 3d |t auth_t|cpport =|
|00002370| 20 31 31 33 3b 0a 69 6e | 74 20 20 20 20 20 20 20 | 113;.in|t |
|00002380| 20 20 20 20 20 61 75 74 | 68 5f 72 74 69 6d 65 6f | aut|h_rtimeo|
|00002390| 75 74 20 3d 20 36 30 3b | 09 2f 2a 20 31 20 6d 69 |ut = 60;|./* 1 mi|
|000023a0| 6e 75 74 65 20 2a 2f 0a | 0a 23 64 65 66 69 6e 65 |nute */.|.#define|
|000023b0| 20 53 49 5a 20 35 30 30 | 20 2f 2a 20 76 61 72 69 | SIZ 500| /* vari|
|000023c0| 6f 75 73 20 62 75 66 66 | 65 72 73 20 2a 2f 0a 0a |ous buff|ers */..|
|000023d0| 73 74 61 74 69 63 20 63 | 6c 65 61 72 73 61 28 73 |static c|learsa(s|
|000023e0| 61 29 0a 20 20 20 20 73 | 74 72 75 63 74 20 73 6f |a). s|truct so|
|000023f0| 63 6b 61 64 64 72 5f 69 | 6e 20 2a 73 61 3b 0a 7b |ckaddr_i|n *sa;.{|
|00002400| 0a 20 20 20 20 72 65 67 | 69 73 74 65 72 20 63 68 |. reg|ister ch|
|00002410| 61 72 20 2a 78 3b 0a 20 | 20 20 20 66 6f 72 20 28 |ar *x;. | for (|
|00002420| 78 20 3d 20 28 63 68 61 | 72 20 2a 29 20 73 61 3b |x = (cha|r *) sa;|
|00002430| 78 20 3c 20 73 69 7a 65 | 6f 66 28 2a 73 61 29 20 |x < size|of(*sa) |
|00002440| 2b 20 28 63 68 61 72 20 | 2a 29 20 73 61 3b 2b 2b |+ (char |*) sa;++|
|00002450| 78 29 0a 09 2a 78 20 3d | 20 30 3b 0a 7d 0a 0a 73 |x)..*x =| 0;.}..s|
|00002460| 74 61 74 69 63 20 69 6e | 74 20 75 73 65 72 63 6d |tatic in|t usercm|
|00002470| 70 28 75 2c 76 29 0a 20 | 20 20 20 72 65 67 69 73 |p(u,v). | regis|
|00002480| 74 65 72 20 63 68 61 72 | 20 2a 75 3b 0a 20 20 20 |ter char| *u;. |
|00002490| 20 72 65 67 69 73 74 65 | 72 20 63 68 61 72 20 2a | registe|r char *|
|000024a0| 76 3b 0a 7b 0a 20 20 20 | 20 72 65 67 69 73 74 65 |v;.{. | registe|
|000024b0| 72 20 63 68 61 72 20 75 | 63 3b 0a 20 20 20 20 72 |r char u|c;. r|
|000024c0| 65 67 69 73 74 65 72 20 | 63 68 61 72 20 76 63 3b |egister |char vc;|
|000024d0| 0a 20 20 20 20 72 65 67 | 69 73 74 65 72 20 63 68 |. reg|ister ch|
|000024e0| 61 72 20 75 63 76 63 3b | 0a 20 20 20 20 2f 2a 20 |ar ucvc;|. /* |
|000024f0| 69 73 20 69 74 20 63 6f | 72 72 65 63 74 20 74 6f |is it co|rrect to|
|00002500| 20 63 6f 6e 73 69 64 65 | 72 20 46 6f 6f 20 61 6e | conside|r Foo an|
|00002510| 64 20 66 4f 6f 20 74 68 | 65 20 73 61 6d 65 20 75 |d fOo th|e same u|
|00002520| 73 65 72 3f 20 79 65 73 | 20 2a 2f 0a 20 20 20 20 |ser? yes| */. |
|00002530| 2f 2a 20 62 75 74 20 74 | 68 65 20 66 75 6e 63 74 |/* but t|he funct|
|00002540| 69 6f 6e 20 6f 66 20 74 | 68 69 73 20 72 6f 75 74 |ion of t|his rout|
|00002550| 69 6e 65 20 6d 61 79 20 | 63 68 61 6e 67 65 20 6c |ine may |change l|
|00002560| 61 74 65 72 20 2a 2f 0a | 20 20 20 20 77 68 69 6c |ater */.| whil|
|00002570| 65 20 28 28 75 63 20 3d | 20 2a 75 29 20 26 26 20 |e ((uc =| *u) && |
|00002580| 28 76 63 20 3d 20 2a 76 | 29 29 0a 20 20 20 20 7b |(vc = *v|)). {|
|00002590| 0a 09 75 63 76 63 20 3d | 20 28 69 73 75 70 70 65 |..ucvc =| (isuppe|
|000025a0| 72 28 75 63 29 20 3f 20 | 74 6f 6c 6f 77 65 72 28 |r(uc) ? |tolower(|
|000025b0| 75 63 29 20 3a 20 75 63 | 29 20 2d 20 28 69 73 75 |uc) : uc|) - (isu|
|000025c0| 70 70 65 72 28 76 63 29 | 20 3f 20 74 6f 6c 6f 77 |pper(vc)| ? tolow|
|000025d0| 65 72 28 76 63 29 20 3a | 20 76 63 29 3b 0a 09 69 |er(vc) :| vc);..i|
|000025e0| 66 20 28 75 63 76 63 29 | 0a 09 20 20 20 20 72 65 |f (ucvc)|.. re|
|000025f0| 74 75 72 6e 20 75 63 76 | 63 3b 0a 09 65 6c 73 65 |turn ucv|c;..else|
|00002600| 0a 09 20 20 20 20 2b 2b | 75 2c 2b 2b 76 3b 0a 20 |.. ++|u,++v;. |
|00002610| 20 20 20 7d 0a 20 20 20 | 20 72 65 74 75 72 6e 20 | }. | return |
|00002620| 75 63 20 7c 7c 20 76 63 | 3b 0a 7d 0a 0a 73 74 61 |uc || vc|;.}..sta|
|00002630| 74 69 63 20 63 68 61 72 | 20 61 75 74 68 6c 69 6e |tic char| authlin|
|00002640| 65 5b 53 49 5a 5d 3b 0a | 0a 63 68 61 72 20 2a 61 |e[SIZ];.|.char *a|
|00002650| 75 74 68 5f 78 6c 69 6e | 65 28 75 73 65 72 2c 66 |uth_xlin|e(user,f|
|00002660| 64 2c 69 6e 29 0a 20 20 | 20 20 72 65 67 69 73 74 |d,in). | regist|
|00002670| 65 72 20 63 68 61 72 20 | 2a 75 73 65 72 3b 20 2f |er char |*user; /|
|00002680| 2a 20 74 68 65 20 73 75 | 70 70 6f 73 65 64 20 6e |* the su|pposed n|
|00002690| 61 6d 65 20 6f 66 20 74 | 68 65 20 75 73 65 72 2c |ame of t|he user,|
|000026a0| 20 4e 55 4c 4c 20 69 66 | 20 75 6e 6b 6e 6f 77 6e | NULL if| unknown|
|000026b0| 20 2a 2f 0a 20 20 20 20 | 72 65 67 69 73 74 65 72 | */. |register|
|000026c0| 20 69 6e 74 20 66 64 3b | 20 2f 2a 20 74 68 65 20 | int fd;| /* the |
|000026d0| 66 69 6c 65 20 64 65 73 | 63 72 69 70 74 6f 72 20 |file des|criptor |
|000026e0| 6f 66 20 74 68 65 20 63 | 6f 6e 6e 65 63 74 69 6f |of the c|onnectio|
|000026f0| 6e 20 2a 2f 0a 20 20 20 | 20 72 65 67 69 73 74 65 |n */. | registe|
|00002700| 72 20 75 6e 73 69 67 6e | 65 64 20 6c 6f 6e 67 20 |r unsign|ed long |
|00002710| 2a 69 6e 3b 0a 7b 0a 20 | 20 20 20 75 6e 73 69 67 |*in;.{. | unsig|
|00002720| 6e 65 64 20 73 68 6f 72 | 74 20 6c 6f 63 61 6c 3b |ned shor|t local;|
|00002730| 0a 20 20 20 20 75 6e 73 | 69 67 6e 65 64 20 73 68 |. uns|igned sh|
|00002740| 6f 72 74 20 72 65 6d 6f | 74 65 3b 0a 20 20 20 20 |ort remo|te;. |
|00002750| 72 65 67 69 73 74 65 72 | 20 63 68 61 72 20 2a 72 |register| char *r|
|00002760| 75 73 65 72 3b 0a 20 20 | 20 20 0a 20 20 20 20 69 |user;. | . i|
|00002770| 66 20 28 61 75 74 68 5f | 66 64 28 66 64 2c 69 6e |f (auth_|fd(fd,in|
|00002780| 2c 26 6c 6f 63 61 6c 2c | 26 72 65 6d 6f 74 65 29 |,&local,|&remote)|
|00002790| 20 3d 3d 20 2d 31 29 0a | 09 72 65 74 75 72 6e 20 | == -1).|.return |
|000027a0| 30 3b 0a 20 20 20 20 72 | 75 73 65 72 20 3d 20 61 |0;. r|user = a|
|000027b0| 75 74 68 5f 74 63 70 75 | 73 65 72 28 2a 69 6e 2c |uth_tcpu|ser(*in,|
|000027c0| 6c 6f 63 61 6c 2c 72 65 | 6d 6f 74 65 29 3b 0a 20 |local,re|mote);. |
|000027d0| 20 20 20 69 66 20 28 21 | 72 75 73 65 72 29 0a 09 | if (!|ruser)..|
|000027e0| 72 65 74 75 72 6e 20 30 | 3b 0a 20 20 20 20 69 66 |return 0|;. if|
|000027f0| 20 28 21 75 73 65 72 29 | 0a 09 75 73 65 72 20 3d | (!user)|..user =|
|00002800| 20 72 75 73 65 72 3b 20 | 2f 2a 20 66 6f 72 63 65 | ruser; |/* force|
|00002810| 73 20 58 2d 41 75 74 68 | 2d 55 73 65 72 20 2a 2f |s X-Auth|-User */|
|00002820| 0a 20 20 20 20 73 70 72 | 69 6e 74 66 28 61 75 74 |. spr|intf(aut|
|00002830| 68 6c 69 6e 65 2c 0a 09 | 20 20 20 20 28 75 73 65 |hline,..| (use|
|00002840| 72 63 6d 70 28 72 75 73 | 65 72 2c 75 73 65 72 29 |rcmp(rus|er,user)|
|00002850| 20 3f 20 22 58 2d 46 6f | 72 67 65 72 79 2d 42 79 | ? "X-Fo|rgery-By|
|00002860| 3a 20 25 73 22 20 3a 20 | 22 58 2d 41 75 74 68 2d |: %s" : |"X-Auth-|
|00002870| 55 73 65 72 3a 20 25 73 | 22 29 2c 0a 09 20 20 20 |User: %s|"),.. |
|00002880| 20 72 75 73 65 72 29 3b | 0a 20 20 20 20 72 65 74 | ruser);|. ret|
|00002890| 75 72 6e 20 61 75 74 68 | 6c 69 6e 65 3b 0a 7d 0a |urn auth|line;.}.|
|000028a0| 0a 69 6e 74 20 61 75 74 | 68 5f 66 64 28 66 64 2c |.int aut|h_fd(fd,|
|000028b0| 69 6e 2c 6c 6f 63 61 6c | 2c 72 65 6d 6f 74 65 29 |in,local|,remote)|
|000028c0| 0a 20 20 20 20 72 65 67 | 69 73 74 65 72 20 69 6e |. reg|ister in|
|000028d0| 74 20 66 64 3b 0a 20 20 | 20 20 72 65 67 69 73 74 |t fd;. | regist|
|000028e0| 65 72 20 75 6e 73 69 67 | 6e 65 64 20 6c 6f 6e 67 |er unsig|ned long|
|000028f0| 20 2a 69 6e 3b 0a 20 20 | 20 20 72 65 67 69 73 74 | *in;. | regist|
|00002900| 65 72 20 75 6e 73 69 67 | 6e 65 64 20 73 68 6f 72 |er unsig|ned shor|
|00002910| 74 20 2a 6c 6f 63 61 6c | 3b 0a 20 20 20 20 72 65 |t *local|;. re|
|00002920| 67 69 73 74 65 72 20 75 | 6e 73 69 67 6e 65 64 20 |gister u|nsigned |
|00002930| 73 68 6f 72 74 20 2a 72 | 65 6d 6f 74 65 3b 0a 7b |short *r|emote;.{|
|00002940| 0a 20 20 20 20 75 6e 73 | 69 67 6e 65 64 20 6c 6f |. uns|igned lo|
|00002950| 6e 67 20 69 6e 6c 6f 63 | 61 6c 3b 0a 20 20 20 20 |ng inloc|al;. |
|00002960| 72 65 74 75 72 6e 20 61 | 75 74 68 5f 66 64 32 28 |return a|uth_fd2(|
|00002970| 66 64 2c 26 69 6e 6c 6f | 63 61 6c 2c 69 6e 2c 6c |fd,&inlo|cal,in,l|
|00002980| 6f 63 61 6c 2c 72 65 6d | 6f 74 65 29 3b 0a 7d 0a |ocal,rem|ote);.}.|
|00002990| 0a 69 6e 74 20 61 75 74 | 68 5f 66 64 32 28 66 64 |.int aut|h_fd2(fd|
|000029a0| 2c 69 6e 6c 6f 63 61 6c | 2c 69 6e 72 65 6d 6f 74 |,inlocal|,inremot|
|000029b0| 65 2c 6c 6f 63 61 6c 2c | 72 65 6d 6f 74 65 29 0a |e,local,|remote).|
|000029c0| 20 20 20 20 72 65 67 69 | 73 74 65 72 20 69 6e 74 | regi|ster int|
|000029d0| 20 66 64 3b 0a 20 20 20 | 20 72 65 67 69 73 74 65 | fd;. | registe|
|000029e0| 72 20 75 6e 73 69 67 6e | 65 64 20 6c 6f 6e 67 20 |r unsign|ed long |
|000029f0| 2a 69 6e 6c 6f 63 61 6c | 3b 0a 20 20 20 20 72 65 |*inlocal|;. re|
|00002a00| 67 69 73 74 65 72 20 75 | 6e 73 69 67 6e 65 64 20 |gister u|nsigned |
|00002a10| 6c 6f 6e 67 20 2a 69 6e | 72 65 6d 6f 74 65 3b 0a |long *in|remote;.|
|00002a20| 20 20 20 20 72 65 67 69 | 73 74 65 72 20 75 6e 73 | regi|ster uns|
|00002a30| 69 67 6e 65 64 20 73 68 | 6f 72 74 20 2a 6c 6f 63 |igned sh|ort *loc|
|00002a40| 61 6c 3b 0a 20 20 20 20 | 72 65 67 69 73 74 65 72 |al;. |register|
|00002a50| 20 75 6e 73 69 67 6e 65 | 64 20 73 68 6f 72 74 20 | unsigne|d short |
|00002a60| 2a 72 65 6d 6f 74 65 3b | 0a 7b 0a 20 20 20 20 73 |*remote;|.{. s|
|00002a70| 74 72 75 63 74 20 73 6f | 63 6b 61 64 64 72 5f 69 |truct so|ckaddr_i|
|00002a80| 6e 20 73 61 3b 0a 20 20 | 20 20 69 6e 74 20 64 75 |n sa;. | int du|
|00002a90| 6d 6d 79 3b 0a 20 20 20 | 20 0a 20 20 20 20 64 75 |mmy;. | . du|
|00002aa0| 6d 6d 79 20 3d 20 73 69 | 7a 65 6f 66 28 73 61 29 |mmy = si|zeof(sa)|
|00002ab0| 3b 0a 20 20 20 20 69 66 | 20 28 67 65 74 73 6f 63 |;. if| (getsoc|
|00002ac0| 6b 6e 61 6d 65 28 66 64 | 2c 26 73 61 2c 26 64 75 |kname(fd|,&sa,&du|
|00002ad0| 6d 6d 79 29 20 3d 3d 20 | 2d 31 29 0a 09 72 65 74 |mmy) == |-1)..ret|
|00002ae0| 75 72 6e 20 2d 31 3b 0a | 20 20 20 20 69 66 20 28 |urn -1;.| if (|
|00002af0| 73 61 2e 73 69 6e 5f 66 | 61 6d 69 6c 79 20 21 3d |sa.sin_f|amily !=|
|00002b00| 20 41 46 5f 49 4e 45 54 | 29 0a 20 20 20 20 7b 0a | AF_INET|). {.|
|00002b10| 09 65 72 72 6e 6f 20 3d | 20 45 41 46 4e 4f 53 55 |.errno =| EAFNOSU|
|00002b20| 50 50 4f 52 54 3b 0a 09 | 72 65 74 75 72 6e 20 2d |PPORT;..|return -|
|00002b30| 31 3b 0a 20 20 20 20 7d | 0a 20 20 20 20 2a 6c 6f |1;. }|. *lo|
|00002b40| 63 61 6c 20 3d 20 6e 74 | 6f 68 73 28 73 61 2e 73 |cal = nt|ohs(sa.s|
|00002b50| 69 6e 5f 70 6f 72 74 29 | 3b 0a 20 20 20 20 2a 69 |in_port)|;. *i|
|00002b60| 6e 6c 6f 63 61 6c 20 3d | 20 73 61 2e 73 69 6e 5f |nlocal =| sa.sin_|
|00002b70| 61 64 64 72 2e 73 5f 61 | 64 64 72 3b 0a 20 20 20 |addr.s_a|ddr;. |
|00002b80| 20 64 75 6d 6d 79 20 3d | 20 73 69 7a 65 6f 66 28 | dummy =| sizeof(|
|00002b90| 73 61 29 3b 0a 20 20 20 | 20 69 66 20 28 67 65 74 |sa);. | if (get|
|00002ba0| 70 65 65 72 6e 61 6d 65 | 28 66 64 2c 26 73 61 2c |peername|(fd,&sa,|
|00002bb0| 26 64 75 6d 6d 79 29 20 | 3d 3d 20 2d 31 29 0a 09 |&dummy) |== -1)..|
|00002bc0| 72 65 74 75 72 6e 20 2d | 31 3b 0a 20 20 20 20 2a |return -|1;. *|
|00002bd0| 72 65 6d 6f 74 65 20 3d | 20 6e 74 6f 68 73 28 73 |remote =| ntohs(s|
|00002be0| 61 2e 73 69 6e 5f 70 6f | 72 74 29 3b 0a 20 20 20 |a.sin_po|rt);. |
|00002bf0| 20 2a 69 6e 72 65 6d 6f | 74 65 20 3d 20 73 61 2e | *inremo|te = sa.|
|00002c00| 73 69 6e 5f 61 64 64 72 | 2e 73 5f 61 64 64 72 3b |sin_addr|.s_addr;|
|00002c10| 0a 20 20 20 20 72 65 74 | 75 72 6e 20 30 3b 0a 7d |. ret|urn 0;.}|
|00002c20| 0a 0a 73 74 61 74 69 63 | 20 63 68 61 72 20 72 75 |..static| char ru|
|00002c30| 73 65 72 5b 53 49 5a 5d | 3b 0a 73 74 61 74 69 63 |ser[SIZ]|;.static|
|00002c40| 20 63 68 61 72 20 72 65 | 61 6c 62 75 66 5b 53 49 | char re|albuf[SI|
|00002c50| 5a 5d 3b 0a 73 74 61 74 | 69 63 20 63 68 61 72 20 |Z];.stat|ic char |
|00002c60| 2a 62 75 66 3b 0a 0a 63 | 68 61 72 20 2a 61 75 74 |*buf;..c|har *aut|
|00002c70| 68 5f 74 63 70 75 73 65 | 72 28 69 6e 2c 6c 6f 63 |h_tcpuse|r(in,loc|
|00002c80| 61 6c 2c 72 65 6d 6f 74 | 65 29 0a 20 20 20 20 72 |al,remot|e). r|
|00002c90| 65 67 69 73 74 65 72 20 | 75 6e 73 69 67 6e 65 64 |egister |unsigned|
|00002ca0| 20 6c 6f 6e 67 20 69 6e | 3b 0a 20 20 20 20 72 65 | long in|;. re|
|00002cb0| 67 69 73 74 65 72 20 75 | 6e 73 69 67 6e 65 64 20 |gister u|nsigned |
|00002cc0| 73 68 6f 72 74 20 6c 6f | 63 61 6c 3b 0a 20 20 20 |short lo|cal;. |
|00002cd0| 20 72 65 67 69 73 74 65 | 72 20 75 6e 73 69 67 6e | registe|r unsign|
|00002ce0| 65 64 20 73 68 6f 72 74 | 20 72 65 6d 6f 74 65 3b |ed short| remote;|
|00002cf0| 0a 7b 0a 20 20 20 20 72 | 65 74 75 72 6e 20 61 75 |.{. r|eturn au|
|00002d00| 74 68 5f 74 63 70 75 73 | 65 72 32 28 30 2c 69 6e |th_tcpus|er2(0,in|
|00002d10| 2c 6c 6f 63 61 6c 2c 72 | 65 6d 6f 74 65 29 3b 0a |,local,r|emote);.|
|00002d20| 7d 0a 0a 23 64 65 66 69 | 6e 65 20 43 4c 4f 52 45 |}..#defi|ne CLORE|
|00002d30| 54 53 28 65 29 20 7b 20 | 73 61 76 65 65 72 72 6e |TS(e) { |saveerrn|
|00002d40| 6f 20 3d 20 65 72 72 6e | 6f 3b 20 63 6c 6f 73 65 |o = errn|o; close|
|00002d50| 28 73 29 3b 20 65 72 72 | 6e 6f 20 3d 20 73 61 76 |(s); err|no = sav|
|00002d60| 65 65 72 72 6e 6f 3b 20 | 72 65 74 75 72 6e 20 65 |eerrno; |return e|
|00002d70| 3b 20 7d 0a 0a 69 6e 74 | 20 61 75 74 68 5f 74 63 |; }..int| auth_tc|
|00002d80| 70 73 6f 63 6b 28 69 6e | 6c 6f 63 61 6c 2c 69 6e |psock(in|local,in|
|00002d90| 72 65 6d 6f 74 65 29 0a | 20 20 20 20 72 65 67 69 |remote).| regi|
|00002da0| 73 74 65 72 20 75 6e 73 | 69 67 6e 65 64 20 6c 6f |ster uns|igned lo|
|00002db0| 6e 67 20 69 6e 6c 6f 63 | 61 6c 3b 0a 20 20 20 20 |ng inloc|al;. |
|00002dc0| 72 65 67 69 73 74 65 72 | 20 75 6e 73 69 67 6e 65 |register| unsigne|
|00002dd0| 64 20 6c 6f 6e 67 20 69 | 6e 72 65 6d 6f 74 65 3b |d long i|nremote;|
|00002de0| 0a 7b 0a 20 20 20 20 73 | 74 72 75 63 74 20 73 6f |.{. s|truct so|
|00002df0| 63 6b 61 64 64 72 5f 69 | 6e 20 73 61 3b 0a 20 20 |ckaddr_i|n sa;. |
|00002e00| 20 20 72 65 67 69 73 74 | 65 72 20 69 6e 74 20 73 | regist|er int s|
|00002e10| 3b 0a 20 20 20 20 72 65 | 67 69 73 74 65 72 20 69 |;. re|gister i|
|00002e20| 6e 74 20 66 6c 3b 0a 20 | 20 20 20 72 65 67 69 73 |nt fl;. | regis|
|00002e30| 74 65 72 20 69 6e 74 20 | 73 61 76 65 65 72 72 6e |ter int |saveerrn|
|00002e40| 6f 3b 0a 20 20 20 20 0a | 20 20 20 20 69 66 20 28 |o;. .| if (|
|00002e50| 28 73 20 3d 20 73 6f 63 | 6b 65 74 28 41 46 5f 49 |(s = soc|ket(AF_I|
|00002e60| 4e 45 54 2c 53 4f 43 4b | 5f 53 54 52 45 41 4d 2c |NET,SOCK|_STREAM,|
|00002e70| 30 29 29 20 3d 3d 20 2d | 31 29 0a 09 72 65 74 75 |0)) == -|1)..retu|
|00002e80| 72 6e 20 2d 31 3b 0a 20 | 20 20 20 69 66 20 28 69 |rn -1;. | if (i|
|00002e90| 6e 6c 6f 63 61 6c 29 0a | 20 20 20 20 7b 0a 09 63 |nlocal).| {..c|
|00002ea0| 6c 65 61 72 73 61 28 26 | 73 61 29 3b 0a 09 73 61 |learsa(&|sa);..sa|
|00002eb0| 2e 73 69 6e 5f 66 61 6d | 69 6c 79 20 3d 20 41 46 |.sin_fam|ily = AF|
|00002ec0| 5f 49 4e 45 54 3b 0a 09 | 73 61 2e 73 69 6e 5f 70 |_INET;..|sa.sin_p|
|00002ed0| 6f 72 74 20 3d 20 30 3b | 0a 09 73 61 2e 73 69 6e |ort = 0;|..sa.sin|
|00002ee0| 5f 61 64 64 72 2e 73 5f | 61 64 64 72 20 3d 20 69 |_addr.s_|addr = i|
|00002ef0| 6e 6c 6f 63 61 6c 3b 0a | 09 69 66 20 28 62 69 6e |nlocal;.|.if (bin|
|00002f00| 64 28 73 2c 26 73 61 2c | 73 69 7a 65 6f 66 28 73 |d(s,&sa,|sizeof(s|
|00002f10| 61 29 29 20 3d 3d 20 2d | 31 29 0a 09 20 20 20 20 |a)) == -|1).. |
|00002f20| 43 4c 4f 52 45 54 53 28 | 2d 31 29 0a 09 20 20 20 |CLORETS(|-1).. |
|00002f30| 20 7d 0a 20 20 20 20 69 | 66 20 28 28 66 6c 20 3d | }. i|f ((fl =|
|00002f40| 20 66 63 6e 74 6c 28 73 | 2c 46 5f 47 45 54 46 4c | fcntl(s|,F_GETFL|
|00002f50| 2c 30 29 29 20 3d 3d 20 | 2d 31 29 0a 09 43 4c 4f |,0)) == |-1)..CLO|
|00002f60| 52 45 54 53 28 2d 31 29 | 3b 0a 20 20 20 20 69 66 |RETS(-1)|;. if|
|00002f70| 20 28 66 63 6e 74 6c 28 | 73 2c 46 5f 53 45 54 46 | (fcntl(|s,F_SETF|
|00002f80| 4c 2c 46 4e 44 45 4c 41 | 59 20 7c 20 66 6c 29 20 |L,FNDELA|Y | fl) |
|00002f90| 3d 3d 20 2d 31 29 0a 09 | 43 4c 4f 52 45 54 53 28 |== -1)..|CLORETS(|
|00002fa0| 2d 31 29 3b 0a 20 20 20 | 20 63 6c 65 61 72 73 61 |-1);. | clearsa|
|00002fb0| 28 26 73 61 29 3b 0a 20 | 20 20 20 73 61 2e 73 69 |(&sa);. | sa.si|
|00002fc0| 6e 5f 66 61 6d 69 6c 79 | 20 3d 20 41 46 5f 49 4e |n_family| = AF_IN|
|00002fd0| 45 54 3b 0a 20 20 20 20 | 73 61 2e 73 69 6e 5f 70 |ET;. |sa.sin_p|
|00002fe0| 6f 72 74 20 3d 20 68 74 | 6f 6e 73 28 61 75 74 68 |ort = ht|ons(auth|
|00002ff0| 5f 74 63 70 70 6f 72 74 | 29 3b 0a 20 20 20 20 73 |_tcpport|);. s|
|00003000| 61 2e 73 69 6e 5f 61 64 | 64 72 2e 73 5f 61 64 64 |a.sin_ad|dr.s_add|
|00003010| 72 20 3d 20 69 6e 72 65 | 6d 6f 74 65 3b 0a 20 20 |r = inre|mote;. |
|00003020| 20 20 69 66 20 28 63 6f | 6e 6e 65 63 74 28 73 2c | if (co|nnect(s,|
|00003030| 26 73 61 2c 73 69 7a 65 | 6f 66 28 73 61 29 29 20 |&sa,size|of(sa)) |
|00003040| 3d 3d 20 2d 31 29 0a 09 | 69 66 20 28 65 72 72 6e |== -1)..|if (errn|
|00003050| 6f 20 21 3d 20 45 49 4e | 50 52 4f 47 52 45 53 53 |o != EIN|PROGRESS|
|00003060| 29 0a 09 20 20 20 20 43 | 4c 4f 52 45 54 53 28 2d |).. C|LORETS(-|
|00003070| 31 29 0a 09 09 72 65 74 | 75 72 6e 20 73 3b 0a 7d |1)...ret|urn s;.}|
|00003080| 0a 0a 63 68 61 72 20 2a | 61 75 74 68 5f 74 63 70 |..char *|auth_tcp|
|00003090| 75 73 65 72 32 28 69 6e | 6c 6f 63 61 6c 2c 69 6e |user2(in|local,in|
|000030a0| 72 65 6d 6f 74 65 2c 6c | 6f 63 61 6c 2c 72 65 6d |remote,l|ocal,rem|
|000030b0| 6f 74 65 29 0a 20 20 20 | 20 72 65 67 69 73 74 65 |ote). | registe|
|000030c0| 72 20 75 6e 73 69 67 6e | 65 64 20 6c 6f 6e 67 20 |r unsign|ed long |
|000030d0| 69 6e 6c 6f 63 61 6c 3b | 0a 20 20 20 20 72 65 67 |inlocal;|. reg|
|000030e0| 69 73 74 65 72 20 75 6e | 73 69 67 6e 65 64 20 6c |ister un|signed l|
|000030f0| 6f 6e 67 20 69 6e 72 65 | 6d 6f 74 65 3b 0a 20 20 |ong inre|mote;. |
|00003100| 20 20 72 65 67 69 73 74 | 65 72 20 75 6e 73 69 67 | regist|er unsig|
|00003110| 6e 65 64 20 73 68 6f 72 | 74 20 6c 6f 63 61 6c 3b |ned shor|t local;|
|00003120| 0a 20 20 20 20 72 65 67 | 69 73 74 65 72 20 75 6e |. reg|ister un|
|00003130| 73 69 67 6e 65 64 20 73 | 68 6f 72 74 20 72 65 6d |signed s|hort rem|
|00003140| 6f 74 65 3b 0a 7b 0a 20 | 20 20 20 72 65 67 69 73 |ote;.{. | regis|
|00003150| 74 65 72 20 69 6e 74 20 | 73 3b 0a 20 20 20 20 0a |ter int |s;. .|
|00003160| 20 20 20 20 73 20 3d 20 | 61 75 74 68 5f 74 63 70 | s = |auth_tcp|
|00003170| 73 6f 63 6b 28 69 6e 6c | 6f 63 61 6c 2c 69 6e 72 |sock(inl|ocal,inr|
|00003180| 65 6d 6f 74 65 29 3b 0a | 20 20 20 20 69 66 20 28 |emote);.| if (|
|00003190| 73 20 3d 3d 20 2d 31 29 | 0a 09 72 65 74 75 72 6e |s == -1)|..return|
|000031a0| 20 30 3b 0a 20 20 20 20 | 72 65 74 75 72 6e 20 61 | 0;. |return a|
|000031b0| 75 74 68 5f 73 6f 63 6b | 75 73 65 72 28 73 2c 6c |uth_sock|user(s,l|
|000031c0| 6f 63 61 6c 2c 72 65 6d | 6f 74 65 29 3b 0a 7d 0a |ocal,rem|ote);.}.|
|000031d0| 0a 63 68 61 72 20 2a 61 | 75 74 68 5f 74 63 70 75 |.char *a|uth_tcpu|
|000031e0| 73 65 72 33 28 69 6e 6c | 6f 63 61 6c 2c 69 6e 72 |ser3(inl|ocal,inr|
|000031f0| 65 6d 6f 74 65 2c 6c 6f | 63 61 6c 2c 72 65 6d 6f |emote,lo|cal,remo|
|00003200| 74 65 2c 63 74 69 6d 65 | 6f 75 74 29 0a 20 20 20 |te,ctime|out). |
|00003210| 20 72 65 67 69 73 74 65 | 72 20 75 6e 73 69 67 6e | registe|r unsign|
|00003220| 65 64 20 6c 6f 6e 67 20 | 69 6e 6c 6f 63 61 6c 3b |ed long |inlocal;|
|00003230| 0a 20 20 20 20 72 65 67 | 69 73 74 65 72 20 75 6e |. reg|ister un|
|00003240| 73 69 67 6e 65 64 20 6c | 6f 6e 67 20 69 6e 72 65 |signed l|ong inre|
|00003250| 6d 6f 74 65 3b 0a 20 20 | 20 20 72 65 67 69 73 74 |mote;. | regist|
|00003260| 65 72 20 75 6e 73 69 67 | 6e 65 64 20 73 68 6f 72 |er unsig|ned shor|
|00003270| 74 20 6c 6f 63 61 6c 3b | 0a 20 20 20 20 72 65 67 |t local;|. reg|
|00003280| 69 73 74 65 72 20 75 6e | 73 69 67 6e 65 64 20 73 |ister un|signed s|
|00003290| 68 6f 72 74 20 72 65 6d | 6f 74 65 3b 0a 20 20 20 |hort rem|ote;. |
|000032a0| 20 72 65 67 69 73 74 65 | 72 20 69 6e 74 20 63 74 | registe|r int ct|
|000032b0| 69 6d 65 6f 75 74 3b 0a | 7b 0a 20 20 20 20 72 65 |imeout;.|{. re|
|000032c0| 74 75 72 6e 20 61 75 74 | 68 5f 74 63 70 75 73 65 |turn aut|h_tcpuse|
|000032d0| 72 34 28 69 6e 6c 6f 63 | 61 6c 2c 0a 09 09 09 20 |r4(inloc|al,.... |
|000032e0| 69 6e 72 65 6d 6f 74 65 | 2c 0a 09 09 09 20 6c 6f |inremote|,.... lo|
|000032f0| 63 61 6c 2c 0a 09 09 09 | 20 72 65 6d 6f 74 65 2c |cal,....| remote,|
|00003300| 0a 09 09 09 20 63 74 69 | 6d 65 6f 75 74 2c 0a 09 |.... cti|meout,..|
|00003310| 09 09 20 61 75 74 68 5f | 72 74 69 6d 65 6f 75 74 |.. auth_|rtimeout|
|00003320| 29 3b 0a 7d 0a 0a 0a 63 | 68 61 72 20 2a 61 75 74 |);.}...c|har *aut|
|00003330| 68 5f 74 63 70 75 73 65 | 72 34 28 69 6e 6c 6f 63 |h_tcpuse|r4(inloc|
|00003340| 61 6c 2c 69 6e 72 65 6d | 6f 74 65 2c 6c 6f 63 61 |al,inrem|ote,loca|
|00003350| 6c 2c 72 65 6d 6f 74 65 | 2c 63 74 69 6d 65 6f 75 |l,remote|,ctimeou|
|00003360| 74 2c 72 74 69 6d 65 6f | 75 74 29 0a 20 20 20 20 |t,rtimeo|ut). |
|00003370| 72 65 67 69 73 74 65 72 | 20 75 6e 73 69 67 6e 65 |register| unsigne|
|00003380| 64 20 6c 6f 6e 67 20 69 | 6e 6c 6f 63 61 6c 3b 0a |d long i|nlocal;.|
|00003390| 20 20 20 20 72 65 67 69 | 73 74 65 72 20 75 6e 73 | regi|ster uns|
|000033a0| 69 67 6e 65 64 20 6c 6f | 6e 67 20 69 6e 72 65 6d |igned lo|ng inrem|
|000033b0| 6f 74 65 3b 0a 20 20 20 | 20 72 65 67 69 73 74 65 |ote;. | registe|
|000033c0| 72 20 75 6e 73 69 67 6e | 65 64 20 73 68 6f 72 74 |r unsign|ed short|
|000033d0| 20 6c 6f 63 61 6c 3b 0a | 20 20 20 20 72 65 67 69 | local;.| regi|
|000033e0| 73 74 65 72 20 75 6e 73 | 69 67 6e 65 64 20 73 68 |ster uns|igned sh|
|000033f0| 6f 72 74 20 72 65 6d 6f | 74 65 3b 0a 20 20 20 20 |ort remo|te;. |
|00003400| 72 65 67 69 73 74 65 72 | 20 69 6e 74 20 63 74 69 |register| int cti|
|00003410| 6d 65 6f 75 74 3b 0a 20 | 20 20 20 72 65 67 69 73 |meout;. | regis|
|00003420| 74 65 72 20 69 6e 74 20 | 72 74 69 6d 65 6f 75 74 |ter int |rtimeout|
|00003430| 3b 0a 7b 0a 20 20 20 20 | 72 65 67 69 73 74 65 72 |;.{. |register|
|00003440| 20 69 6e 74 20 73 3b 0a | 20 20 20 20 73 74 72 75 | int s;.| stru|
|00003450| 63 74 20 74 69 6d 65 76 | 61 6c 20 63 74 76 3b 0a |ct timev|al ctv;.|
|00003460| 20 20 20 20 66 64 5f 73 | 65 74 20 77 66 64 73 3b | fd_s|et wfds;|
|00003470| 0a 20 20 20 20 72 65 67 | 69 73 74 65 72 20 69 6e |. reg|ister in|
|00003480| 74 20 72 3b 0a 20 20 20 | 20 72 65 67 69 73 74 65 |t r;. | registe|
|00003490| 72 20 69 6e 74 20 73 61 | 76 65 65 72 72 6e 6f 3b |r int sa|veerrno;|
|000034a0| 0a 20 20 20 20 76 6f 69 | 64 20 2a 6f 6c 64 5f 73 |. voi|d *old_s|
|000034b0| 69 67 3b 0a 20 20 20 20 | 63 68 61 72 20 2a 72 65 |ig;. |char *re|
|000034c0| 74 76 61 6c 3b 0a 20 20 | 20 20 0a 20 20 20 20 0a |tval;. | . .|
|000034d0| 20 20 20 20 6f 6c 64 5f | 73 69 67 20 3d 20 73 69 | old_|sig = si|
|000034e0| 67 6e 61 6c 28 53 49 47 | 50 49 50 45 2c 20 53 49 |gnal(SIG|PIPE, SI|
|000034f0| 47 5f 49 47 4e 29 3b 0a | 20 20 20 20 0a 20 20 20 |G_IGN);.| . |
|00003500| 20 73 20 3d 20 61 75 74 | 68 5f 74 63 70 73 6f 63 | s = aut|h_tcpsoc|
|00003510| 6b 28 69 6e 6c 6f 63 61 | 6c 2c 69 6e 72 65 6d 6f |k(inloca|l,inremo|
|00003520| 74 65 29 3b 0a 20 20 20 | 20 69 66 20 28 73 20 3d |te);. | if (s =|
|00003530| 3d 20 2d 31 29 0a 20 20 | 20 20 7b 0a 09 73 69 67 |= -1). | {..sig|
|00003540| 6e 61 6c 28 53 49 47 50 | 49 50 45 2c 20 6f 6c 64 |nal(SIGP|IPE, old|
|00003550| 5f 73 69 67 29 3b 0a 09 | 72 65 74 75 72 6e 20 30 |_sig);..|return 0|
|00003560| 3b 0a 20 20 20 20 7d 0a | 20 20 20 20 63 74 76 2e |;. }.| ctv.|
|00003570| 74 76 5f 73 65 63 20 3d | 20 63 74 69 6d 65 6f 75 |tv_sec =| ctimeou|
|00003580| 74 3b 0a 20 20 20 20 63 | 74 76 2e 74 76 5f 75 73 |t;. c|tv.tv_us|
|00003590| 65 63 20 3d 20 30 3b 0a | 20 20 20 20 46 44 5f 5a |ec = 0;.| FD_Z|
|000035a0| 45 52 4f 28 26 77 66 64 | 73 29 3b 0a 20 20 20 20 |ERO(&wfd|s);. |
|000035b0| 46 44 5f 53 45 54 28 73 | 2c 26 77 66 64 73 29 3b |FD_SET(s|,&wfds);|
|000035c0| 0a 20 20 20 20 72 20 3d | 20 73 65 6c 65 63 74 28 |. r =| select(|
|000035d0| 73 20 2b 20 31 2c 28 66 | 64 5f 73 65 74 20 2a 29 |s + 1,(f|d_set *)|
|000035e0| 20 30 2c 26 77 66 64 73 | 2c 28 66 64 5f 73 65 74 | 0,&wfds|,(fd_set|
|000035f0| 20 2a 29 20 30 2c 26 63 | 74 76 29 3b 0a 20 20 20 | *) 0,&c|tv);. |
|00003600| 20 2f 2a 20 58 58 58 3a | 20 68 6f 77 20 74 6f 20 | /* XXX:| how to |
|00003610| 68 61 6e 64 6c 65 20 45 | 49 4e 54 52 3f 20 2a 2f |handle E|INTR? */|
|00003620| 0a 20 20 20 20 69 66 20 | 28 72 20 3d 3d 20 2d 31 |. if |(r == -1|
|00003630| 29 0a 20 20 20 20 7b 0a | 09 73 69 67 6e 61 6c 28 |). {.|.signal(|
|00003640| 53 49 47 50 49 50 45 2c | 20 6f 6c 64 5f 73 69 67 |SIGPIPE,| old_sig|
|00003650| 29 3b 0a 09 43 4c 4f 52 | 45 54 53 28 30 29 3b 0a |);..CLOR|ETS(0);.|
|00003660| 20 20 20 20 7d 0a 20 20 | 20 20 69 66 20 28 21 46 | }. | if (!F|
|00003670| 44 5f 49 53 53 45 54 28 | 73 2c 26 77 66 64 73 29 |D_ISSET(|s,&wfds)|
|00003680| 29 0a 20 20 20 20 7b 0a | 09 63 6c 6f 73 65 28 73 |). {.|.close(s|
|00003690| 29 3b 0a 09 65 72 72 6e | 6f 20 3d 20 45 54 49 4d |);..errn|o = ETIM|
|000036a0| 45 44 4f 55 54 3b 0a 09 | 73 69 67 6e 61 6c 28 53 |EDOUT;..|signal(S|
|000036b0| 49 47 50 49 50 45 2c 20 | 6f 6c 64 5f 73 69 67 29 |IGPIPE, |old_sig)|
|000036c0| 3b 0a 09 72 65 74 75 72 | 6e 20 30 3b 0a 20 20 20 |;..retur|n 0;. |
|000036d0| 20 7d 0a 20 20 20 20 72 | 65 74 76 61 6c 20 3d 20 | }. r|etval = |
|000036e0| 61 75 74 68 5f 73 6f 63 | 6b 75 73 65 72 32 28 73 |auth_soc|kuser2(s|
|000036f0| 2c 6c 6f 63 61 6c 2c 72 | 65 6d 6f 74 65 2c 72 74 |,local,r|emote,rt|
|00003700| 69 6d 65 6f 75 74 29 3b | 0a 20 20 20 20 73 69 67 |imeout);|. sig|
|00003710| 6e 61 6c 28 53 49 47 50 | 49 50 45 2c 20 6f 6c 64 |nal(SIGP|IPE, old|
|00003720| 5f 73 69 67 29 3b 0a 20 | 20 20 20 0a 20 20 20 20 |_sig);. | . |
|00003730| 72 65 74 75 72 6e 20 72 | 65 74 76 61 6c 3b 0a 7d |return r|etval;.}|
|00003740| 0a 0a 63 68 61 72 20 2a | 61 75 74 68 5f 73 6f 63 |..char *|auth_soc|
|00003750| 6b 75 73 65 72 28 73 2c | 6c 6f 63 61 6c 2c 72 65 |kuser(s,|local,re|
|00003760| 6d 6f 74 65 29 0a 20 20 | 20 20 72 65 67 69 73 74 |mote). | regist|
|00003770| 65 72 20 69 6e 74 20 73 | 3b 0a 20 20 20 20 72 65 |er int s|;. re|
|00003780| 67 69 73 74 65 72 20 75 | 6e 73 69 67 6e 65 64 20 |gister u|nsigned |
|00003790| 73 68 6f 72 74 20 6c 6f | 63 61 6c 3b 0a 20 20 20 |short lo|cal;. |
|000037a0| 20 72 65 67 69 73 74 65 | 72 20 75 6e 73 69 67 6e | registe|r unsign|
|000037b0| 65 64 20 73 68 6f 72 74 | 20 72 65 6d 6f 74 65 3b |ed short| remote;|
|000037c0| 0a 7b 0a 20 20 20 20 72 | 65 74 75 72 6e 20 61 75 |.{. r|eturn au|
|000037d0| 74 68 5f 73 6f 63 6b 75 | 73 65 72 32 28 73 2c 20 |th_socku|ser2(s, |
|000037e0| 6c 6f 63 61 6c 2c 20 72 | 65 6d 6f 74 65 2c 20 61 |local, r|emote, a|
|000037f0| 75 74 68 5f 72 74 69 6d | 65 6f 75 74 29 3b 0a 7d |uth_rtim|eout);.}|
|00003800| 0a 0a 63 68 61 72 20 2a | 61 75 74 68 5f 73 6f 63 |..char *|auth_soc|
|00003810| 6b 75 73 65 72 32 28 73 | 2c 6c 6f 63 61 6c 2c 72 |kuser2(s|,local,r|
|00003820| 65 6d 6f 74 65 2c 72 74 | 69 6d 65 6f 75 74 29 0a |emote,rt|imeout).|
|00003830| 20 20 20 20 72 65 67 69 | 73 74 65 72 20 69 6e 74 | regi|ster int|
|00003840| 20 73 3b 0a 20 20 20 20 | 72 65 67 69 73 74 65 72 | s;. |register|
|00003850| 20 75 6e 73 69 67 6e 65 | 64 20 73 68 6f 72 74 20 | unsigne|d short |
|00003860| 6c 6f 63 61 6c 3b 0a 20 | 20 20 20 72 65 67 69 73 |local;. | regis|
|00003870| 74 65 72 20 75 6e 73 69 | 67 6e 65 64 20 73 68 6f |ter unsi|gned sho|
|00003880| 72 74 20 72 65 6d 6f 74 | 65 3b 0a 20 20 20 20 69 |rt remot|e;. i|
|00003890| 6e 74 20 72 74 69 6d 65 | 6f 75 74 3b 0a 7b 0a 20 |nt rtime|out;.{. |
|000038a0| 20 20 20 72 65 67 69 73 | 74 65 72 20 69 6e 74 20 | regis|ter int |
|000038b0| 62 75 66 6c 65 6e 3b 0a | 20 20 20 20 72 65 67 69 |buflen;.| regi|
|000038c0| 73 74 65 72 20 69 6e 74 | 20 77 3b 0a 20 20 20 20 |ster int| w;. |
|000038d0| 72 65 67 69 73 74 65 72 | 20 69 6e 74 20 73 61 76 |register| int sav|
|000038e0| 65 65 72 72 6e 6f 3b 0a | 20 20 20 20 63 68 61 72 |eerrno;.| char|
|000038f0| 20 63 68 3b 0a 20 20 20 | 20 75 6e 73 69 67 6e 65 | ch;. | unsigne|
|00003900| 64 20 73 68 6f 72 74 20 | 72 6c 6f 63 61 6c 3b 0a |d short |rlocal;.|
|00003910| 20 20 20 20 75 6e 73 69 | 67 6e 65 64 20 73 68 6f | unsi|gned sho|
|00003920| 72 74 20 72 72 65 6d 6f | 74 65 3b 0a 20 20 20 20 |rt rremo|te;. |
|00003930| 72 65 67 69 73 74 65 72 | 20 69 6e 74 20 66 6c 3b |register| int fl;|
|00003940| 0a 20 20 20 20 66 64 5f | 73 65 74 20 77 66 64 73 |. fd_|set wfds|
|00003950| 3b 0a 20 20 20 20 76 6f | 69 64 20 2a 6f 6c 64 5f |;. vo|id *old_|
|00003960| 73 69 67 3b 0a 20 20 20 | 20 73 74 72 75 63 74 20 |sig;. | struct |
|00003970| 74 69 6d 65 76 61 6c 20 | 72 74 76 3b 0a 20 20 20 |timeval |rtv;. |
|00003980| 20 0a 20 20 20 20 6f 6c | 64 5f 73 69 67 20 3d 20 | . ol|d_sig = |
|00003990| 73 69 67 6e 61 6c 28 53 | 49 47 50 49 50 45 2c 20 |signal(S|IGPIPE, |
|000039a0| 53 49 47 5f 49 47 4e 29 | 3b 0a 20 20 20 20 0a 20 |SIG_IGN)|;. . |
|000039b0| 20 20 20 46 44 5f 5a 45 | 52 4f 28 26 77 66 64 73 | FD_ZE|RO(&wfds|
|000039c0| 29 3b 0a 20 20 20 20 46 | 44 5f 53 45 54 28 73 2c |);. F|D_SET(s,|
|000039d0| 26 77 66 64 73 29 3b 0a | 20 20 20 20 0a 20 20 20 |&wfds);.| . |
|000039e0| 20 73 65 6c 65 63 74 28 | 73 20 2b 20 31 2c 0a 09 | select(|s + 1,..|
|000039f0| 20 20 20 28 66 64 5f 73 | 65 74 20 2a 29 20 30 2c | (fd_s|et *) 0,|
|00003a00| 0a 09 20 20 20 26 77 66 | 64 73 2c 28 66 64 5f 73 |.. &wf|ds,(fd_s|
|00003a10| 65 74 20 2a 29 20 30 2c | 0a 09 20 20 20 28 73 74 |et *) 0,|.. (st|
|00003a20| 72 75 63 74 20 74 69 6d | 65 76 61 6c 20 2a 29 20 |ruct tim|eval *) |
|00003a30| 30 29 3b 0a 20 20 20 20 | 0a 20 20 20 20 2f 2a 20 |0);. |. /* |
|00003a40| 6e 6f 77 20 73 20 69 73 | 20 77 72 69 74 61 62 6c |now s is| writabl|
|00003a50| 65 20 2a 2f 0a 20 20 20 | 20 69 66 20 28 28 66 6c |e */. | if ((fl|
|00003a60| 20 3d 20 66 63 6e 74 6c | 28 73 2c 46 5f 47 45 54 | = fcntl|(s,F_GET|
|00003a70| 46 4c 2c 30 29 29 20 3d | 3d 20 2d 31 29 0a 20 20 |FL,0)) =|= -1). |
|00003a80| 20 20 7b 0a 09 73 69 67 | 6e 61 6c 28 53 49 47 50 | {..sig|nal(SIGP|
|00003a90| 49 50 45 2c 20 6f 6c 64 | 5f 73 69 67 29 3b 0a 09 |IPE, old|_sig);..|
|00003aa0| 43 4c 4f 52 45 54 53 28 | 30 29 3b 0a 20 20 20 20 |CLORETS(|0);. |
|00003ab0| 7d 0a 20 20 20 20 69 66 | 20 28 66 63 6e 74 6c 28 |}. if| (fcntl(|
|00003ac0| 73 2c 46 5f 53 45 54 46 | 4c 2c 7e 46 4e 44 45 4c |s,F_SETF|L,~FNDEL|
|00003ad0| 41 59 20 26 20 66 6c 29 | 20 3d 3d 20 2d 31 29 0a |AY & fl)| == -1).|
|00003ae0| 20 20 20 20 7b 0a 09 73 | 69 67 6e 61 6c 28 53 49 | {..s|ignal(SI|
|00003af0| 47 50 49 50 45 2c 20 6f | 6c 64 5f 73 69 67 29 3b |GPIPE, o|ld_sig);|
|00003b00| 0a 09 43 4c 4f 52 45 54 | 53 28 30 29 3b 0a 20 20 |..CLORET|S(0);. |
|00003b10| 20 20 7d 0a 20 20 20 20 | 62 75 66 20 3d 20 72 65 | }. |buf = re|
|00003b20| 61 6c 62 75 66 3b 0a 20 | 20 20 20 73 70 72 69 6e |albuf;. | sprin|
|00003b30| 74 66 28 62 75 66 2c 22 | 25 75 20 2c 20 25 75 5c |tf(buf,"|%u , %u\|
|00003b40| 72 5c 6e 22 2c 28 75 6e | 73 69 67 6e 65 64 20 69 |r\n",(un|signed i|
|00003b50| 6e 74 29 20 72 65 6d 6f | 74 65 2c 28 75 6e 73 69 |nt) remo|te,(unsi|
|00003b60| 67 6e 65 64 20 69 6e 74 | 29 20 6c 6f 63 61 6c 29 |gned int|) local)|
|00003b70| 3b 0a 20 20 20 20 2f 2a | 20 6e 6f 74 65 20 74 68 |;. /*| note th|
|00003b80| 65 20 72 65 76 65 72 73 | 65 64 20 6f 72 64 65 72 |e revers|ed order|
|00003b90| 2d 2d 2d 74 68 65 20 65 | 78 61 6d 70 6c 65 20 69 |---the e|xample i|
|00003ba0| 6e 20 52 46 43 20 39 33 | 31 20 69 73 20 6d 69 73 |n RFC 93|1 is mis|
|00003bb0| 6c 65 61 64 69 6e 67 20 | 2a 2f 0a 20 20 20 20 62 |leading |*/. b|
|00003bc0| 75 66 6c 65 6e 20 3d 20 | 73 74 72 6c 65 6e 28 62 |uflen = |strlen(b|
|00003bd0| 75 66 29 3b 0a 20 20 20 | 20 77 68 69 6c 65 20 28 |uf);. | while (|
|00003be0| 28 77 20 3d 20 77 72 69 | 74 65 28 73 2c 62 75 66 |(w = wri|te(s,buf|
|00003bf0| 2c 62 75 66 6c 65 6e 29 | 29 20 3c 20 62 75 66 6c |,buflen)|) < bufl|
|00003c00| 65 6e 29 0a 09 69 66 20 | 28 77 20 3d 3d 20 2d 31 |en)..if |(w == -1|
|00003c10| 29 20 2f 2a 20 73 68 6f | 75 6c 64 20 77 65 20 77 |) /* sho|uld we w|
|00003c20| 6f 72 72 79 20 61 62 6f | 75 74 20 30 20 61 73 20 |orry abo|ut 0 as |
|00003c30| 77 65 6c 6c 3f 20 2a 2f | 0a 09 7b 0a 09 20 20 20 |well? */|..{.. |
|00003c40| 20 73 69 67 6e 61 6c 28 | 53 49 47 50 49 50 45 2c | signal(|SIGPIPE,|
|00003c50| 20 6f 6c 64 5f 73 69 67 | 29 3b 0a 09 20 20 20 20 | old_sig|);.. |
|00003c60| 43 4c 4f 52 45 54 53 28 | 30 29 3b 0a 09 7d 0a 09 |CLORETS(|0);..}..|
|00003c70| 65 6c 73 65 0a 09 7b 0a | 09 20 20 20 20 62 75 66 |else..{.|. buf|
|00003c80| 20 2b 3d 20 77 3b 0a 09 | 20 20 20 20 62 75 66 6c | += w;..| bufl|
|00003c90| 65 6e 20 2d 3d 20 77 3b | 0a 09 7d 0a 20 20 20 20 |en -= w;|..}. |
|00003ca0| 62 75 66 20 3d 20 72 65 | 61 6c 62 75 66 3b 0a 20 |buf = re|albuf;. |
|00003cb0| 20 20 20 0a 20 20 20 20 | 64 6f 0a 20 20 20 20 7b | . |do. {|
|00003cc0| 0a 09 66 64 5f 73 65 74 | 20 72 64 5f 66 64 73 3b |..fd_set| rd_fds;|
|00003cd0| 0a 09 0a 09 72 74 76 2e | 74 76 5f 73 65 63 20 3d |....rtv.|tv_sec =|
|00003ce0| 20 72 74 69 6d 65 6f 75 | 74 3b 0a 09 72 74 76 2e | rtimeou|t;..rtv.|
|00003cf0| 74 76 5f 75 73 65 63 20 | 3d 20 30 3b 0a 20 20 20 |tv_usec |= 0;. |
|00003d00| 20 0a 09 46 44 5f 5a 45 | 52 4f 28 26 72 64 5f 66 | ..FD_ZE|RO(&rd_f|
|00003d10| 64 73 29 3b 0a 09 46 44 | 5f 53 45 54 28 73 2c 20 |ds);..FD|_SET(s, |
|00003d20| 26 72 64 5f 66 64 73 29 | 3b 0a 09 69 66 20 28 73 |&rd_fds)|;..if (s|
|00003d30| 65 6c 65 63 74 28 73 2b | 31 2c 0a 09 09 20 20 20 |elect(s+|1,... |
|00003d40| 26 72 64 5f 66 64 73 2c | 0a 09 09 20 20 20 28 66 |&rd_fds,|... (f|
|00003d50| 64 5f 73 65 74 20 2a 29 | 20 30 2c 0a 09 09 20 20 |d_set *)| 0,... |
|00003d60| 20 28 66 64 5f 73 65 74 | 20 2a 29 20 30 2c 0a 09 | (fd_set| *) 0,..|
|00003d70| 09 20 20 20 26 72 74 76 | 29 20 3d 3d 20 30 29 0a |. &rtv|) == 0).|
|00003d80| 09 7b 0a 09 20 20 20 20 | 77 20 3d 20 2d 31 3b 0a |.{.. |w = -1;.|
|00003d90| 09 20 20 20 20 67 6f 74 | 6f 20 45 4e 44 3b 0a 09 |. got|o END;..|
|00003da0| 7d 0a 09 0a 09 69 66 20 | 28 28 77 20 3d 20 72 65 |}....if |((w = re|
|00003db0| 61 64 28 73 2c 26 63 68 | 2c 31 29 29 20 3d 3d 20 |ad(s,&ch|,1)) == |
|00003dc0| 31 29 0a 09 7b 0a 09 20 | 20 20 20 2a 62 75 66 20 |1)..{.. | *buf |
|00003dd0| 3d 20 63 68 3b 0a 09 20 | 20 20 20 69 66 20 28 28 |= ch;.. | if ((|
|00003de0| 63 68 20 21 3d 20 27 20 | 27 29 20 26 26 20 28 63 |ch != ' |') && (c|
|00003df0| 68 20 21 3d 20 27 5c 74 | 27 29 20 26 26 20 28 63 |h != '\t|') && (c|
|00003e00| 68 20 21 3d 20 27 5c 72 | 27 29 29 0a 09 09 2b 2b |h != '\r|'))...++|
|00003e10| 62 75 66 3b 0a 09 20 20 | 20 20 69 66 20 28 28 62 |buf;.. | if ((b|
|00003e20| 75 66 20 2d 20 72 65 61 | 6c 62 75 66 20 3d 3d 20 |uf - rea|lbuf == |
|00003e30| 73 69 7a 65 6f 66 28 72 | 65 61 6c 62 75 66 29 20 |sizeof(r|ealbuf) |
|00003e40| 2d 20 31 29 20 7c 7c 20 | 28 63 68 20 3d 3d 20 27 |- 1) || |(ch == '|
|00003e50| 5c 6e 27 29 29 0a 09 09 | 62 72 65 61 6b 3b 0a 09 |\n'))...|break;..|
|00003e60| 7d 0a 20 20 20 20 7d 20 | 77 68 69 6c 65 20 28 77 |}. } |while (w|
|00003e70| 20 3d 3d 20 31 29 3b 0a | 20 20 20 20 0a 20 20 20 | == 1);.| . |
|00003e80| 20 45 4e 44 3a 20 0a 20 | 20 20 20 73 69 67 6e 61 | END: . | signa|
|00003e90| 6c 28 53 49 47 50 49 50 | 45 2c 20 6f 6c 64 5f 73 |l(SIGPIP|E, old_s|
|00003ea0| 69 67 29 3b 0a 20 20 20 | 20 69 66 20 28 77 20 3d |ig);. | if (w =|
|00003eb0| 3d 20 2d 31 29 0a 09 43 | 4c 4f 52 45 54 53 28 30 |= -1)..C|LORETS(0|
|00003ec0| 29 0a 09 20 20 20 20 2a | 62 75 66 20 3d 20 30 3b |).. *|buf = 0;|
|00003ed0| 0a 20 20 20 20 0a 20 20 | 20 20 69 66 20 28 73 73 |. . | if (ss|
|00003ee0| 63 61 6e 66 28 72 65 61 | 6c 62 75 66 2c 20 22 25 |canf(rea|lbuf, "%|
|00003ef0| 68 64 2c 25 68 64 3a 20 | 55 53 45 52 49 44 20 3a |hd,%hd: |USERID :|
|00003f00| 25 2a 5b 5e 3a 5d 3a 25 | 73 22 2c 0a 09 20 20 20 |%*[^:]:%|s",.. |
|00003f10| 20 20 20 20 26 72 72 65 | 6d 6f 74 65 2c 20 26 72 | &rre|mote, &r|
|00003f20| 6c 6f 63 61 6c 2c 20 72 | 75 73 65 72 29 20 3c 20 |local, r|user) < |
|00003f30| 33 29 0a 20 20 20 20 7b | 0a 09 63 6c 6f 73 65 28 |3). {|..close(|
|00003f40| 73 29 3b 0a 09 65 72 72 | 6e 6f 20 3d 20 45 49 4f |s);..err|no = EIO|
|00003f50| 3b 0a 09 2f 2a 20 6d 61 | 6b 65 73 20 73 65 6e 73 |;../* ma|kes sens|
|00003f60| 65 2c 20 72 69 67 68 74 | 3f 20 77 65 6c 6c 2c 20 |e, right|? well, |
|00003f70| 6e 6f 74 20 77 68 65 6e | 20 55 53 45 52 49 44 20 |not when| USERID |
|00003f80| 66 61 69 6c 65 64 20 74 | 6f 20 6d 61 74 63 68 20 |failed t|o match |
|00003f90| 45 52 52 4f 52 20 2a 2f | 0a 09 2f 2a 20 62 75 74 |ERROR */|../* but|
|00003fa0| 20 74 68 65 72 65 27 73 | 20 6e 6f 20 67 6f 6f 64 | there's| no good|
|00003fb0| 20 65 72 72 6f 72 20 74 | 6f 20 72 65 74 75 72 6e | error t|o return|
|00003fc0| 20 69 6e 20 74 68 61 74 | 20 63 61 73 65 20 2a 2f | in that| case */|
|00003fd0| 0a 09 72 65 74 75 72 6e | 20 30 3b 0a 20 20 20 20 |..return| 0;. |
|00003fe0| 7d 0a 20 20 20 20 69 66 | 20 28 28 72 65 6d 6f 74 |}. if| ((remot|
|00003ff0| 65 20 21 3d 20 72 72 65 | 6d 6f 74 65 29 20 7c 7c |e != rre|mote) |||
|00004000| 20 28 6c 6f 63 61 6c 20 | 21 3d 20 72 6c 6f 63 61 | (local |!= rloca|
|00004010| 6c 29 29 0a 20 20 20 20 | 7b 0a 09 63 6c 6f 73 65 |l)). |{..close|
|00004020| 28 73 29 3b 0a 09 65 72 | 72 6e 6f 20 3d 20 45 49 |(s);..er|rno = EI|
|00004030| 4f 3b 0a 09 72 65 74 75 | 72 6e 20 30 3b 0a 20 20 |O;..retu|rn 0;. |
|00004040| 20 20 7d 0a 20 20 20 20 | 2f 2a 20 77 65 27 72 65 | }. |/* we're|
|00004050| 20 6e 6f 74 20 67 6f 69 | 6e 67 20 74 6f 20 64 6f | not goi|ng to do|
|00004060| 20 61 6e 79 20 62 61 63 | 6b 73 6c 61 73 68 20 70 | any bac|kslash p|
|00004070| 72 6f 63 65 73 73 69 6e | 67 20 2a 2f 0a 20 20 20 |rocessin|g */. |
|00004080| 20 63 6c 6f 73 65 28 73 | 29 3b 0a 20 20 20 20 72 | close(s|);. r|
|00004090| 65 74 75 72 6e 20 72 75 | 73 65 72 3b 0a 7d 0a 0a |eturn ru|ser;.}..|
|000040a0| 0a 34 2e 30 2e 20 50 75 | 62 6c 69 63 20 64 6f 6d |.4.0. Pu|blic dom|
|000040b0| 61 69 6e 2e 0a 20 2a 2a | 20 32 2f 39 2f 39 32 3a |ain.. **| 2/9/92:|
|000040c0| 20 61 64 64 65 64 20 62 | 75 6e 63 68 65 73 20 6f | added b|unches o|
|000040d0| 66 20 7a 65 72 6f 69 6e | 67 20 6a 75 73 74 20 69 |f zeroin|g just i|
|000040e0| 6e 20 63 61 73 65 2e 0a | 20 2a 2a 20 32 2f 39 2f |n case..| ** 2/9/|
|000040f0| 39 32 3a 20 61 64 64 65 | 64 20 61 75 74 68 5f 74 |92: adde|d auth_t|
|00004100| 63 70 75 73 65 72 33 2e | 20 75 73 65 73 20 62 73 |cpuser3.| uses bs|
|00004110| 64 20 34 2e 33 20 73 65 | 6c 65 63 74 20 69 6e 74 |d 4.3 se|lect int|
|00004120| 65 72 66 61 63 65 2e 0a | 20 2a 2a 20 32 2f 39 2f |erface..| ** 2/9/|
|00004130| 39 32 3a 20 61 64 64 65 | 64 20 61 75 74 68 5f 74 |92: adde|d auth_t|
|00004140| 63 70 73 6f 63 6b 2c 20 | 61 75 74 68 5f 73 6f 63 |cpsock, |auth_soc|
|00004150| 6b 75 73 65 72 2e 0a 20 | 2a 2a 20 32 2f 39 2f 39 |kuser.. |** 2/9/9|
|00004160| 32 3a 20 61 64 64 65 64 | 20 61 75 74 68 5f 66 64 |2: added| auth_fd|
|00004170| 32 2c 20 61 75 74 68 5f | 74 63 70 75 73 65 72 32 |2, auth_|tcpuser2|
|00004180| 2c 20 73 69 6d 70 6c 69 | 66 69 65 64 20 73 6f 6d |, simpli|fied som|
|00004190| 65 20 6f 66 20 74 68 65 | 20 63 6f 64 65 2e 0a 20 |e of the| code.. |
|000041a0| 2a 2a 20 31 32 2f 32 37 | 2f 39 31 3a 20 66 69 78 |** 12/27|/91: fix|
|000041b0| 65 64 20 75 70 20 75 73 | 65 72 63 6d 70 20 74 6f |ed up us|ercmp to|
|000041c0| 20 64 65 61 6c 20 77 69 | 74 68 20 72 65 73 74 72 | deal wi|th restr|
|000041d0| 69 63 74 65 64 20 74 6f | 6c 6f 77 65 72 20 58 58 |icted to|lower XX|
|000041e0| 58 0a 20 2a 2a 20 35 2f | 36 2f 39 31 20 44 4a 42 |X. ** 5/|6/91 DJB|
|000041f0| 20 62 61 73 65 6c 69 6e | 65 20 61 75 74 68 75 73 | baselin|e authus|
|00004200| 6c 69 62 61 75 74 68 2d | 34 2e 30 2d 70 35 2f 52 |libauth-|4.0-p5/R|
|00004210| 45 41 44 4d 45 00 00 00 | 00 00 00 00 00 00 00 00 |EADME...|........|
|00004220| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004230| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004240| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004250| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004260| 00 00 00 00 20 20 20 36 | 34 34 20 00 20 20 20 31 |.... 6|44 . 1|
|00004270| 37 31 20 00 20 20 20 20 | 33 36 20 00 20 20 20 20 |71 . |36 . |
|00004280| 20 20 20 31 33 35 35 20 | 20 35 33 33 33 34 34 35 | 1355 | 5333445|
|00004290| 33 35 37 20 20 20 37 32 | 35 37 00 20 00 00 00 00 |357 72|57. ....|
|000042a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000042b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000042c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000042d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000042e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000042f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004300| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004310| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004320| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004330| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004340| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004350| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004360| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004370| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004380| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004390| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000043a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000043b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000043c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000043d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000043e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000043f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004400| 54 68 69 73 20 69 73 20 | 76 65 72 73 69 6f 6e 20 |This is |version |
|00004410| 34 2e 30 20 6f 66 20 44 | 61 6e 73 20 61 75 74 68 |4.0 of D|ans auth|
|00004420| 75 73 65 72 20 6c 69 62 | 72 61 72 79 20 77 69 74 |user lib|rary wit|
|00004430| 68 20 61 20 70 61 74 63 | 68 20 61 70 70 6c 69 65 |h a patc|h applie|
|00004440| 64 20 74 6f 0a 63 61 74 | 63 68 20 74 68 65 20 53 |d to.cat|ch the S|
|00004450| 49 47 50 49 50 45 20 73 | 69 67 6e 61 6c 20 74 68 |IGPIPE s|ignal th|
|00004460| 61 74 20 63 61 6e 20 6f | 63 63 75 72 20 77 68 65 |at can o|ccur whe|
|00004470| 6e 20 77 72 69 74 69 6e | 67 20 74 6f 20 61 20 72 |n writin|g to a r|
|00004480| 65 6d 6f 74 65 0a 6e 6f | 6e 2d 65 78 69 73 74 61 |emote.no|n-exista|
|00004490| 6e 74 20 61 75 74 68 20 | 64 61 65 6d 6f 6e 2e 20 |nt auth |daemon. |
|000044a0| 54 68 65 72 65 20 69 73 | 20 61 6c 73 6f 20 61 20 |There is| also a |
|000044b0| 70 61 74 63 68 20 61 70 | 70 6c 69 65 64 20 74 68 |patch ap|plied th|
|000044c0| 61 74 20 66 69 78 65 73 | 0a 74 68 65 20 28 70 72 |at fixes|.the (pr|
|000044d0| 65 76 69 6f 75 73 6c 79 | 29 20 69 6e 63 6f 72 72 |eviously|) incorr|
|000044e0| 65 63 74 20 61 72 67 75 | 6d 65 6e 74 20 64 65 63 |ect argu|ment dec|
|000044f0| 6c 61 72 61 74 69 6f 6e | 20 74 6f 20 63 6c 65 61 |laration| to clea|
|00004500| 72 73 61 28 29 2e 0a 0a | 54 68 65 72 65 20 69 73 |rsa()...|There is|
|00004510| 20 61 6c 73 6f 20 61 20 | 6e 65 77 20 66 75 6e 63 | also a |new func|
|00004520| 74 69 6f 6e 2c 20 61 75 | 74 68 5f 74 63 70 75 73 |tion, au|th_tcpus|
|00004530| 65 72 34 28 29 20 77 69 | 74 68 20 61 20 61 64 64 |er4() wi|th a add|
|00004540| 69 74 69 6f 6e 61 6c 0a | 6c 61 73 74 20 61 72 67 |itional.|last arg|
|00004550| 75 6d 65 6e 74 20 74 68 | 61 74 20 73 70 65 63 69 |ument th|at speci|
|00004560| 66 69 65 73 20 74 68 65 | 20 6d 61 78 69 6d 75 6d |fies the| maximum|
|00004570| 20 61 6d 6f 75 6e 74 20 | 6f 66 20 74 69 6d 65 20 | amount |of time |
|00004580| 74 6f 0a 77 61 69 74 20 | 6f 6e 20 72 65 61 64 28 |to.wait |on read(|
|00004590| 29 3a 69 6e 67 20 74 68 | 65 20 72 65 70 6c 79 20 |):ing th|e reply |
|000045a0| 66 72 6f 6d 20 74 68 65 | 20 72 65 6d 6f 74 65 20 |from the| remote |
|000045b0| 49 64 65 6e 74 20 73 65 | 72 76 65 72 2e 20 54 68 |Ident se|rver. Th|
|000045c0| 69 73 0a 69 73 20 73 6f | 20 74 68 61 74 20 74 68 |is.is so| that th|
|000045d0| 69 6e 67 73 20 77 6f 6e | 27 74 20 68 61 6e 67 20 |ings won|'t hang |
|000045e0| 69 66 20 69 74 20 69 73 | 6e 27 74 20 61 6e 20 49 |if it is|n't an I|
|000045f0| 64 65 6e 74 20 73 65 72 | 76 65 72 20 61 74 20 74 |dent ser|ver at t|
|00004600| 68 65 0a 6f 74 68 65 72 | 20 65 6e 64 2e 2e 2e 20 |he.other| end... |
|00004610| 61 75 74 68 5f 74 63 70 | 75 73 65 72 33 28 29 20 |auth_tcp|user3() |
|00004620| 63 61 6c 6c 73 20 61 75 | 74 68 5f 74 63 70 75 73 |calls au|th_tcpus|
|00004630| 65 72 34 28 29 20 77 69 | 74 68 20 61 20 72 65 61 |er4() wi|th a rea|
|00004640| 64 2d 74 69 6d 65 6f 75 | 74 0a 6f 66 20 33 30 20 |d-timeou|t.of 30 |
|00004650| 73 65 63 6f 6e 64 73 2c | 20 73 6f 20 69 66 20 74 |seconds,| so if t|
|00004660| 68 65 20 72 65 6d 6f 74 | 65 20 73 69 74 65 20 74 |he remot|e site t|
|00004670| 72 61 6e 73 6d 69 74 73 | 20 74 68 65 20 72 65 73 |ransmits| the res|
|00004680| 75 6c 74 20 61 74 20 61 | 20 73 6c 6f 77 65 72 0a |ult at a| slower.|
|00004690| 70 61 63 65 20 74 68 61 | 6e 20 74 68 61 74 20 79 |pace tha|n that y|
|000046a0| 6f 75 20 77 69 6c 6c 20 | 67 65 74 20 61 6e 20 65 |ou will |get an e|
|000046b0| 72 72 6f 72 20 62 61 63 | 6b 2e 0a 0a 2f 50 65 74 |rror bac|k.../Pet|
|000046c0| 65 72 20 45 72 69 6b 73 | 73 6f 6e 20 28 70 65 6e |er Eriks|son (pen|
|000046d0| 40 6c 79 73 61 74 6f 72 | 2e 6c 69 75 2e 73 65 29 |@lysator|.liu.se)|
|000046e0| 2c 20 32 20 46 65 62 20 | 31 39 39 33 0a 3c 65 72 |, 2 Feb |1993.<er|
|000046f0| 72 6e 6f 2e 68 3e 0a 65 | 78 74 65 72 6e 20 69 6e |rno.h>.e|xtern in|
|00004700| 74 20 65 72 72 6e 6f 3b | 0a 23 69 6e 63 6c 75 64 |t errno;|.#includ|
|00004710| 65 20 22 61 75 74 68 75 | 73 65 72 2e 68 22 0a 0a |e "authu|ser.h"..|
|00004720| 23 69 66 6e 64 65 66 20 | 46 4e 44 45 4c 41 59 0a |#ifndef |FNDELAY.|
|00004730| 23 20 20 64 65 66 69 6e | 65 20 46 4e 44 45 4c 41 |# defin|e FNDELA|
|00004740| 59 20 4f 5f 4e 44 45 4c | 41 59 0a 23 65 6e 64 69 |Y O_NDEL|AY.#endi|
|00004750| 66 0a 0a 75 6e 73 69 67 | 6e 65 64 20 73 68 6f 72 |f..unsig|ned shor|
|00004760| 74 20 61 75 74 68 5f 74 | 63 70 70 6f 72 74 20 3d |t auth_t|cpport =|
|00004770| 20 31 31 33 3b 0a 69 6e | 74 20 20 20 20 20 20 20 | 113;.in|t |
|00004780| 20 20 20 20 20 61 75 74 | 68 5f 72 74 69 6d 65 6f | aut|h_rtimeo|
|00004790| 75 74 20 3d 20 36 30 3b | 09 2f 2a 20 31 20 6d 69 |ut = 60;|./* 1 mi|
|000047a0| 6e 75 74 65 20 2a 2f 0a | 0a 23 64 65 66 69 6e 65 |nute */.|.#define|
|000047b0| 20 53 49 5a 20 35 30 30 | 20 2f 2a 20 76 61 72 69 | SIZ 500| /* vari|
|000047c0| 6f 75 73 20 62 75 66 66 | 65 72 73 20 2a 2f 0a 0a |ous buff|ers */..|
|000047d0| 73 74 61 74 69 63 20 63 | 6c 65 61 72 73 61 28 73 |static c|learsa(s|
|000047e0| 61 29 0a 20 20 20 20 73 | 74 72 75 63 74 20 73 6f |a). s|truct so|
|000047f0| 63 6b 61 64 64 72 5f 69 | 6e 20 2a 73 61 3b 0a 7b |ckaddr_i|n *sa;.{|
|00004800| 6c 69 62 61 75 74 68 2d | 34 2e 30 2d 70 35 2f 43 |libauth-|4.0-p5/C|
|00004810| 68 61 6e 67 65 4c 6f 67 | 00 00 00 00 00 00 00 00 |hangeLog|........|
|00004820| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004830| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004840| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004850| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004860| 00 00 00 00 20 20 20 36 | 34 34 20 00 20 20 20 31 |.... 6|44 . 1|
|00004870| 37 31 20 00 20 20 20 20 | 33 36 20 00 20 20 20 20 |71 . |36 . |
|00004880| 20 20 20 20 33 32 33 20 | 20 35 32 33 33 30 37 32 | 323 | 5233072|
|00004890| 33 30 35 20 20 31 30 31 | 30 37 00 20 00 00 00 00 |305 101|07. ....|
|000048a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000048b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000048c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000048d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000048e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000048f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004900| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004910| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004920| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004930| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004940| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004950| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004960| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004970| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004980| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004990| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000049a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000049b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000049c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000049d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000049e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000049f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004a00| 54 75 65 20 4a 75 6c 20 | 32 31 20 32 32 3a 33 33 |Tue Jul |21 22:33|
|00004a10| 3a 35 38 20 31 39 39 32 | 20 20 50 65 74 65 72 20 |:58 1992| Peter |
|00004a20| 45 72 69 6b 73 73 6f 6e | 20 20 28 70 65 6e 40 6c |Eriksson| (pen@l|
|00004a30| 79 73 61 74 6f 72 29 0a | 0a 09 2a 20 46 69 78 65 |ysator).|..* Fixe|
|00004a40| 64 20 53 49 47 50 49 50 | 45 20 62 75 67 20 61 72 |d SIGPIP|E bug ar|
|00004a50| 6f 75 6e 64 20 73 65 6c | 65 63 74 28 29 20 69 6e |ound sel|ect() in|
|00004a60| 20 61 75 74 68 5f 74 63 | 70 75 73 65 72 33 28 29 | auth_tc|puser3()|
|00004a70| 2e 0a 0a 54 68 75 20 4d | 61 72 20 31 32 20 30 31 |...Thu M|ar 12 01|
|00004a80| 3a 30 31 3a 31 30 20 31 | 39 39 32 20 20 50 65 74 |:01:10 1|992 Pet|
|00004a90| 65 72 20 45 72 69 6b 73 | 73 6f 6e 20 20 28 70 65 |er Eriks|son (pe|
|00004aa0| 6e 40 72 6f 62 65 72 74 | 29 0a 0a 09 2a 20 46 69 |n@robert|)...* Fi|
|00004ab0| 78 65 64 20 53 49 47 50 | 49 50 45 20 62 75 67 20 |xed SIGP|IPE bug |
|00004ac0| 61 72 6f 75 6e 64 20 77 | 72 69 74 65 28 29 2e 0a |around w|rite()..|
|00004ad0| 09 0a 0a 6f 75 73 6c 79 | 29 20 69 6e 63 6f 72 72 |...ously|) incorr|
|00004ae0| 65 63 74 20 61 72 67 75 | 6d 65 6e 74 20 64 65 63 |ect argu|ment dec|
|00004af0| 6c 61 72 61 74 69 6f 6e | 20 74 6f 20 63 6c 65 61 |laration| to clea|
|00004b00| 72 73 61 28 29 2e 0a 0a | 54 68 65 72 65 20 69 73 |rsa()...|There is|
|00004b10| 20 61 6c 73 6f 20 61 20 | 6e 65 77 20 66 75 6e 63 | also a |new func|
|00004b20| 74 69 6f 6e 2c 20 61 75 | 74 68 5f 74 63 70 75 73 |tion, au|th_tcpus|
|00004b30| 65 72 34 28 29 20 77 69 | 74 68 20 61 20 61 64 64 |er4() wi|th a add|
|00004b40| 69 74 69 6f 6e 61 6c 0a | 6c 61 73 74 20 61 72 67 |itional.|last arg|
|00004b50| 75 6d 65 6e 74 20 74 68 | 61 74 20 73 70 65 63 69 |ument th|at speci|
|00004b60| 66 69 65 73 20 74 68 65 | 20 6d 61 78 69 6d 75 6d |fies the| maximum|
|00004b70| 20 61 6d 6f 75 6e 74 20 | 6f 66 20 74 69 6d 65 20 | amount |of time |
|00004b80| 74 6f 0a 77 61 69 74 20 | 6f 6e 20 72 65 61 64 28 |to.wait |on read(|
|00004b90| 29 3a 69 6e 67 20 74 68 | 65 20 72 65 70 6c 79 20 |):ing th|e reply |
|00004ba0| 66 72 6f 6d 20 74 68 65 | 20 72 65 6d 6f 74 65 20 |from the| remote |
|00004bb0| 49 64 65 6e 74 20 73 65 | 72 76 65 72 2e 20 54 68 |Ident se|rver. Th|
|00004bc0| 69 73 0a 69 73 20 73 6f | 20 74 68 61 74 20 74 68 |is.is so| that th|
|00004bd0| 69 6e 67 73 20 77 6f 6e | 27 74 20 68 61 6e 67 20 |ings won|'t hang |
|00004be0| 69 66 20 69 74 20 69 73 | 6e 27 74 20 61 6e 20 49 |if it is|n't an I|
|00004bf0| 64 65 6e 74 20 73 65 72 | 76 65 72 20 61 74 20 74 |dent ser|ver at t|
|00004c00| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004c10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004c20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004c30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004c40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004c50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004c60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004c70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004c80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004c90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004ca0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004cb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004cc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004cd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004ce0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004cf0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004d00| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004d10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004d20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004d30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004d40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004d50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004d60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004d70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004d80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004d90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004da0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004db0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004dc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004dd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004de0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004df0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004e00| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004e10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004e20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004e30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004e40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004e50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004e60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004e70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004e80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004e90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004ea0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004eb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004ec0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004ed0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004ee0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004ef0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f00| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004fa0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004fb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004fc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004fd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004fe0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004ff0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005000| 6f 63 6b 75 73 65 72 28 | 5c 66 49 73 2c 6c 6f 63 |ockuser(|\fIs,loc|
|00005010| 61 6c 2c 72 65 6d 6f 74 | 65 5c 66 42 29 0a 6d 61 |al,remot|e\fB).ma|
|00005020| 6b 65 73 20 73 75 72 65 | 20 74 68 61 74 20 74 68 |kes sure| that th|
|00005030| 65 20 73 6f 63 6b 65 74 | 20 68 61 73 20 63 6f 6e |e socket| has con|
|00005040| 6e 65 63 74 65 64 20 61 | 6e 64 0a 74 68 65 6e 20 |nected a|nd.then |
|00005050| 64 6f 65 73 20 74 68 65 | 20 73 61 6d 65 20 6a 6f |does the| same jo|
|00005060| 62 20 61 73 0a 2e 42 20 | 61 75 74 68 5f 74 63 70 |b as..B |auth_tcp|
|00005070| 75 73 65 72 32 2c 0a 72 | 65 74 75 72 6e 69 6e 67 |user2,.r|eturning|
|00005080| 20 74 68 65 20 6e 61 6d | 65 20 6f 66 20 74 68 65 | the nam|e of the|
|00005090| 20 75 73 65 72 20 6f 6e | 20 74 68 65 20 6f 74 68 | user on| the oth|
|000050a0| 65 72 20 65 6e 64 20 6f | 66 20 74 68 65 20 54 43 |er end o|f the TC|
|000050b0| 50 20 63 6f 6e 6e 65 63 | 74 69 6f 6e 0a 62 65 74 |P connec|tion.bet|
|000050c0| 77 65 65 6e 0a 2e 49 20 | 72 65 6d 6f 74 65 40 69 |ween..I |remote@i|
|000050d0| 6e 72 65 6d 6f 74 65 0a | 61 6e 64 0a 2e 49 20 6c |nremote.|and..I l|
|000050e0| 6f 63 61 6c 40 69 6e 6c | 6f 63 61 6c 2c 0a 6f 72 |ocal@inl|ocal,.or|
|000050f0| 20 4e 55 4c 4c 20 28 77 | 69 74 68 20 65 72 72 6e | NULL (w|ith errn|
|00005100| 6f 20 73 65 74 29 20 69 | 66 20 61 75 74 68 65 6e |o set) i|f authen|
|00005110| 74 69 63 61 74 69 6f 6e | 20 69 73 20 6e 6f 74 20 |tication| is not |
|00005120| 70 6f 73 73 69 62 6c 65 | 2e 0a 2e 49 20 73 0a 69 |possible|...I s.i|
|00005130| 73 20 63 6c 6f 73 65 64 | 20 62 79 0a 2e 42 20 61 |s closed| by..B a|
|00005140| 75 74 68 5f 73 6f 63 6b | 75 73 65 72 2e 0a 54 68 |uth_sock|user..Th|
|00005150| 65 20 61 64 76 61 6e 74 | 61 67 65 20 6f 66 0a 75 |e advant|age of.u|
|00005160| 73 69 6e 67 0a 2e 42 20 | 61 75 74 68 5f 74 63 70 |sing..B |auth_tcp|
|00005170| 73 6f 63 6b 0a 61 6e 64 | 0a 2e 42 20 61 75 74 68 |sock.and|..B auth|
|00005180| 5f 73 6f 63 6b 75 73 65 | 72 0a 69 6e 73 74 65 61 |_sockuse|r.instea|
|00005190| 64 20 6f 66 0a 2e 42 20 | 61 75 74 68 5f 74 63 70 |d of..B |auth_tcp|
|000051a0| 75 73 65 72 32 0a 69 73 | 20 74 68 61 74 20 79 6f |user2.is| that yo|
|000051b0| 75 20 63 61 6e 20 70 65 | 72 66 6f 72 6d 20 6f 74 |u can pe|rform ot|
|000051c0| 68 65 72 20 61 63 74 69 | 6f 6e 73 20 77 68 69 6c |her acti|ons whil|
|000051d0| 65 20 77 61 69 74 69 6e | 67 20 66 6f 72 20 74 68 |e waitin|g for th|
|000051e0| 65 0a 61 75 74 68 65 6e | 74 69 63 61 74 69 6f 6e |e.authen|tication|
|000051f0| 20 72 65 71 75 65 73 74 | 20 74 6f 20 63 6f 6d 70 | request| to comp|
|00005200| 6c 65 74 65 2e 0a 59 6f | 75 20 63 61 6e 20 73 65 |lete..Yo|u can se|
|00005210| 6c 65 63 74 0a 2e 49 20 | 73 0a 66 6f 72 20 77 72 |lect..I |s.for wr|
|00005220| 69 74 69 6e 67 0a 74 6f | 20 73 65 65 20 69 66 20 |iting.to| see if |
|00005230| 69 74 20 69 73 20 72 65 | 61 64 79 20 66 6f 72 0a |it is re|ady for.|
|00005240| 2e 42 20 61 75 74 68 5f | 73 6f 63 6b 75 73 65 72 |.B auth_|sockuser|
|00005250| 0a 79 65 74 2e 0a 0a 2e | 42 20 61 75 74 68 5f 74 |.yet....|B auth_t|
|00005260| 63 70 75 73 65 72 33 28 | 5c 66 49 69 6e 6c 6f 63 |cpuser3(|\fIinloc|
|00005270| 61 6c 2c 69 6e 72 65 6d | 6f 74 65 2c 6c 6f 63 61 |al,inrem|ote,loca|
|00005280| 6c 2c 72 65 6d 6f 74 65 | 2c 63 74 69 6d 65 6f 75 |l,remote|,ctimeou|
|00005290| 74 5c 66 42 29 0a 69 73 | 20 6c 69 6b 65 0a 2e 42 |t\fB).is| like..B|
|000052a0| 20 61 75 74 68 5f 74 63 | 70 75 73 65 72 32 0a 62 | auth_tc|puser2.b|
|000052b0| 75 74 0a 72 65 74 75 72 | 6e 73 0a 4e 55 4c 4c 20 |ut.retur|ns.NULL |
|000052c0| 77 69 74 68 20 65 72 72 | 6e 6f 20 73 65 74 20 74 |with err|no set t|
|000052d0| 6f 20 45 54 49 4d 45 44 | 4f 55 54 0a 69 66 20 74 |o ETIMED|OUT.if t|
|000052e0| 68 65 20 61 75 74 68 65 | 6e 74 69 63 61 74 69 6f |he authe|nticatio|
|000052f0| 6e 20 72 65 71 75 65 73 | 74 20 68 61 73 20 6e 6f |n reques|t has no|
|00005300| 74 20 62 65 65 6e 20 61 | 63 63 65 70 74 65 64 20 |t been a|ccepted |
|00005310| 6f 72 20 72 65 66 75 73 | 65 64 20 61 66 74 65 72 |or refus|ed after|
|00005320| 0a 2e 49 20 63 74 69 6d | 65 6f 75 74 0a 73 65 63 |..I ctim|eout.sec|
|00005330| 6f 6e 64 73 2e 0a 0a 2e | 42 20 61 75 74 68 5f 74 |onds....|B auth_t|
|00005340| 63 70 75 73 65 72 34 28 | 5c 66 49 69 6e 6c 6f 63 |cpuser4(|\fIinloc|
|00005350| 61 6c 2c 69 6e 72 65 6d | 6f 74 65 2c 6c 6f 63 61 |al,inrem|ote,loca|
|00005360| 6c 2c 72 65 6d 6f 74 65 | 2c 63 74 69 6d 65 6f 75 |l,remote|,ctimeou|
|00005370| 74 2c 72 74 69 6d 65 6f | 75 74 5c 66 42 29 0a 69 |t,rtimeo|ut\fB).i|
|00005380| 73 20 6c 69 6b 65 0a 2e | 42 20 61 75 74 68 5f 74 |s like..|B auth_t|
|00005390| 63 70 75 73 65 72 33 0a | 62 75 74 20 72 65 74 75 |cpuser3.|but retu|
|000053a0| 72 6e 73 0a 4e 55 4c 4c | 20 77 69 74 68 20 65 72 |rns.NULL| with er|
|000053b0| 72 6e 6f 20 73 65 74 20 | 74 6f 20 45 54 49 4d 45 |rno set |to ETIME|
|000053c0| 44 4f 55 54 0a 69 66 20 | 74 68 65 20 72 65 70 6c |DOUT.if |the repl|
|000053d0| 79 20 74 6f 20 74 68 65 | 20 61 75 74 68 65 6e 74 |y to the| authent|
|000053e0| 69 63 61 74 69 6f 6e 20 | 72 65 71 75 65 73 74 20 |ication |request |
|000053f0| 69 73 20 62 65 69 6e 67 | 20 73 65 6e 74 20 73 6c |is being| sent sl|
|00005400| 6f 77 65 72 20 74 68 61 | 6e 0a 2e 49 20 72 74 69 |ower tha|n..I rti|
|00005410| 6d 65 6f 75 74 0a 73 65 | 63 6f 6e 64 73 2f 63 68 |meout.se|conds/ch|
|00005420| 61 72 61 63 74 65 72 2e | 0a 0a 2e 42 20 61 75 74 |aracter.|...B aut|
|00005430| 68 5f 66 64 28 5c 66 49 | 66 64 2c 26 69 6e 72 65 |h_fd(\fI|fd,&inre|
|00005440| 6d 6f 74 65 2c 26 6c 6f | 63 61 6c 2c 26 72 65 6d |mote,&lo|cal,&rem|
|00005450| 6f 74 65 5c 66 42 29 0a | 69 73 20 74 68 65 20 73 |ote\fB).|is the s|
|00005460| 61 6d 65 20 61 73 0a 2e | 42 20 61 75 74 68 5f 66 |ame as..|B auth_f|
|00005470| 64 32 0a 62 75 74 20 74 | 68 72 6f 77 73 20 61 77 |d2.but t|hrows aw|
|00005480| 61 79 20 74 68 65 0a 2e | 49 20 69 6e 6c 6f 63 61 |ay the..|I inloca|
|00005490| 6c 0a 69 6e 66 6f 72 6d | 61 74 69 6f 6e 2e 0a 2e |l.inform|ation...|
|000054a0| 42 20 61 75 74 68 5f 74 | 63 70 75 73 65 72 28 5c |B auth_t|cpuser(\|
|000054b0| 66 49 69 6e 72 65 6d 6f | 74 65 2c 6c 6f 63 61 6c |fIinremo|te,local|
|000054c0| 2c 72 65 6d 6f 74 65 5c | 66 42 29 0a 69 73 20 74 |,remote\|fB).is t|
|000054d0| 68 65 20 73 61 6d 65 20 | 61 73 0a 2e 42 20 61 75 |he same |as..B au|
|000054e0| 74 68 5f 74 63 70 75 73 | 65 72 32 0a 62 75 74 20 |th_tcpus|er2.but |
|000054f0| 6d 61 79 20 6e 6f 74 20 | 62 69 6e 64 20 74 6f 20 |may not |bind to |
|00005500| 74 68 65 20 70 72 6f 70 | 65 72 20 6c 6f 63 61 6c |the prop|er local|
|00005510| 20 61 64 64 72 65 73 73 | 20 6f 6e 0a 68 6f 73 74 | address| on.host|
|00005520| 73 20 77 69 74 68 20 6d | 75 6c 74 69 70 6c 65 20 |s with m|ultiple |
|00005530| 49 50 20 61 64 64 72 65 | 73 73 65 73 2e 0a 54 68 |IP addre|sses..Th|
|00005540| 65 73 65 20 66 75 6e 63 | 74 69 6f 6e 73 20 64 6f |ese func|tions do|
|00005550| 20 6e 6f 74 20 70 65 72 | 66 6f 72 6d 20 70 72 6f | not per|form pro|
|00005560| 70 65 72 6c 79 20 6f 6e | 20 6d 75 6c 74 69 68 6f |perly on| multiho|
|00005570| 6d 65 64 0a 68 6f 73 74 | 73 20 61 6e 64 20 73 68 |med.host|s and sh|
|00005580| 6f 75 6c 64 20 6e 6f 74 | 20 62 65 20 75 73 65 64 |ould not| be used|
|00005590| 2e 0a 54 68 65 79 20 61 | 72 65 20 70 72 6f 76 69 |..They a|re provi|
|000055a0| 64 65 64 20 6f 6e 6c 79 | 20 66 6f 72 20 62 61 63 |ded only| for bac|
|000055b0| 6b 77 61 72 64 73 20 63 | 6f 6d 70 61 74 69 62 69 |kwards c|ompatibi|
|000055c0| 6c 69 74 79 2e 0a 0a 54 | 68 65 20 61 75 74 68 65 |lity...T|he authe|
|000055d0| 6e 74 69 63 61 74 69 6f | 6e 20 72 6f 75 74 69 6e |nticatio|n routin|
|000055e0| 65 73 20 63 68 65 63 6b | 20 77 69 74 68 20 74 68 |es check| with th|
|000055f0| 65 0a 72 65 6d 6f 74 65 | 20 41 75 74 68 65 6e 74 |e.remote| Authent|
|00005600| 69 63 61 74 69 6f 6e 20 | 53 65 72 76 65 72 20 6f |ication |Server o|
|00005610| 6e 20 70 6f 72 74 0a 2e | 42 20 61 75 74 68 5f 74 |n port..|B auth_t|
|00005620| 63 70 70 6f 72 74 2c 0a | 77 68 69 63 68 20 64 65 |cpport,.|which de|
|00005630| 66 61 75 6c 74 73 20 74 | 6f 20 31 31 33 0a 61 73 |faults t|o 113.as|
|00005640| 20 73 70 65 63 69 66 69 | 65 64 20 62 79 20 52 46 | specifi|ed by RF|
|00005650| 43 20 39 33 31 2e 0a 59 | 6f 75 20 63 61 6e 20 73 |C 931..Y|ou can s|
|00005660| 65 74 0a 2e 42 20 61 75 | 74 68 5f 74 63 70 70 6f |et..B au|th_tcppo|
|00005670| 72 74 0a 74 6f 20 6f 74 | 68 65 72 20 76 61 6c 75 |rt.to ot|her valu|
|00005680| 65 73 0a 66 6f 72 20 6e | 6f 6e 73 74 61 6e 64 61 |es.for n|onstanda|
|00005690| 72 64 20 69 6d 70 6c 65 | 6d 65 6e 74 61 74 69 6f |rd imple|mentatio|
|000056a0| 6e 73 2e 0a 2e 53 48 20 | 52 45 53 54 52 49 43 54 |ns...SH |RESTRICT|
|000056b0| 49 4f 4e 53 0a 2e 42 20 | 61 75 74 68 75 73 65 72 |IONS..B |authuser|
|000056c0| 0a 64 6f 65 73 20 6e 6f | 20 62 61 63 6b 73 6c 61 |.does no| backsla|
|000056d0| 73 68 20 69 6e 74 65 72 | 70 72 65 74 61 74 69 6f |sh inter|pretatio|
|000056e0| 6e 0a 75 70 6f 6e 20 74 | 68 65 20 72 65 6d 6f 74 |n.upon t|he remot|
|000056f0| 65 20 75 73 65 72 20 6e | 61 6d 65 2e 0a 54 68 69 |e user n|ame..Thi|
|00005700| 73 20 69 73 20 63 6f 6e | 66 6f 72 6d 61 6e 63 65 |s is con|formance|
|00005710| 20 77 69 74 68 20 74 68 | 65 20 70 72 6f 70 6f 73 | with th|e propos|
|00005720| 65 64 20 72 65 76 69 73 | 69 6f 6e 20 74 6f 0a 52 |ed revis|ion to.R|
|00005730| 46 43 20 39 33 31 2e 0a | 0a 2e 42 20 61 75 74 68 |FC 931..|..B auth|
|00005740| 75 73 65 72 0a 64 6f 65 | 73 20 6e 6f 74 20 75 73 |user.doe|s not us|
|00005750| 65 20 74 68 65 20 6f 70 | 65 72 61 74 69 6e 67 20 |e the op|erating |
|00005760| 73 79 73 74 65 6d 20 74 | 79 70 65 0a 69 6e 66 6f |system t|ype.info|
|00005770| 72 6d 61 74 69 6f 6e 20 | 70 72 6f 76 69 64 65 64 |rmation |provided|
|00005780| 20 62 79 20 74 68 65 20 | 41 75 74 68 65 6e 74 69 | by the |Authenti|
|00005790| 63 61 74 69 6f 6e 20 53 | 65 72 76 65 72 2e 0a 2e |cation S|erver...|
|000057a0| 53 48 20 56 45 52 53 49 | 4f 4e 0a 61 75 74 68 75 |SH VERSI|ON.authu|
|000057b0| 73 65 72 20 76 65 72 73 | 69 6f 6e 20 34 2e 30 2c |ser vers|ion 4.0,|
|000057c0| 20 46 65 62 72 75 61 72 | 79 20 39 2c 20 31 39 39 | Februar|y 9, 199|
|000057d0| 32 2e 0a 2e 53 48 20 41 | 55 54 48 4f 52 0a 50 6c |2...SH A|UTHOR.Pl|
|000057e0| 61 63 65 64 20 69 6e 74 | 6f 20 74 68 65 20 70 75 |aced int|o the pu|
|000057f0| 62 6c 69 63 20 64 6f 6d | 61 69 6e 20 62 79 20 44 |blic dom|ain by D|
|00005800| 61 6e 69 65 6c 20 4a 2e | 20 42 65 72 6e 73 74 65 |aniel J.| Bernste|
|00005810| 69 6e 2e 0a 2e 53 48 20 | 52 45 46 45 52 45 4e 43 |in...SH |REFERENC|
|00005820| 45 53 0a 54 68 65 20 61 | 75 74 68 65 6e 74 69 63 |ES.The a|uthentic|
|00005830| 61 74 69 6f 6e 20 73 65 | 72 76 65 72 20 69 73 20 |ation se|rver is |
|00005840| 6d 6f 72 65 20 73 65 63 | 75 72 65 20 74 68 61 6e |more sec|ure than|
|00005850| 20 70 61 73 73 77 6f 72 | 64 73 0a 69 6e 20 73 6f | passwor|ds.in so|
|00005860| 6d 65 20 77 61 79 73 2c | 20 62 75 74 20 6c 65 73 |me ways,| but les|
|00005870| 73 20 73 65 63 75 72 65 | 20 74 68 61 6e 20 70 61 |s secure| than pa|
|00005880| 73 73 77 6f 72 64 73 20 | 69 6e 20 6d 61 6e 79 20 |sswords |in many |
|00005890| 77 61 79 73 2e 0a 28 49 | 74 27 73 20 63 65 72 74 |ways..(I|t's cert|
|000058a0| 61 69 6e 6c 79 20 62 65 | 74 74 65 72 20 74 68 61 |ainly be|tter tha|
|000058b0| 6e 20 6e 6f 20 70 61 73 | 73 77 6f 72 64 20 61 74 |n no pas|sword at|
|000058c0| 20 61 6c 6c 2d 2d 2d 65 | 2e 67 2e 2c 20 66 6f 72 | all---e|.g., for|
|000058d0| 0a 6d 61 69 6c 20 6f 72 | 20 6e 65 77 73 2e 29 0a |.mail or| news.).|
|000058e0| 49 74 20 69 73 20 6e 6f | 74 20 74 68 65 20 66 69 |It is no|t the fi|
|000058f0| 6e 61 6c 20 73 6f 6c 75 | 74 69 6f 6e 2e 0a 46 6f |nal solu|tion..Fo|
|00005900| 72 20 61 6e 20 65 78 63 | 65 6c 6c 65 6e 74 20 64 |r an exc|ellent d|
|00005910| 69 73 63 75 73 73 69 6f | 6e 20 6f 66 20 73 65 63 |iscussio|n of sec|
|00005920| 75 72 69 74 79 20 70 72 | 6f 62 6c 65 6d 73 20 77 |urity pr|oblems w|
|00005930| 69 74 68 69 6e 0a 74 68 | 65 20 54 43 50 2f 49 50 |ithin.th|e TCP/IP|
|00005940| 20 70 72 6f 74 6f 63 6f | 6c 20 73 75 69 74 65 2c | protoco|l suite,|
|00005950| 20 73 65 65 0a 53 74 65 | 76 65 20 42 65 6c 6c 6f | see.Ste|ve Bello|
|00005960| 76 69 6e 27 73 20 61 72 | 74 69 63 6c 65 0a 60 60 |vin's ar|ticle.``|
|00005970| 53 65 63 75 72 69 74 79 | 20 50 72 6f 62 6c 65 6d |Security| Problem|
|00005980| 73 20 69 6e 20 74 68 65 | 20 54 43 50 2f 49 50 20 |s in the| TCP/IP |
|00005990| 50 72 6f 74 6f 63 6f 6c | 20 53 75 69 74 65 2e 27 |Protocol| Suite.'|
|000059a0| 27 0a 2e 53 48 20 22 53 | 45 45 20 41 4c 53 4f 22 |'..SH "S|EE ALSO"|
|000059b0| 0a 74 63 70 63 6c 69 65 | 6e 74 28 31 29 2c 0a 74 |.tcpclie|nt(1),.t|
|000059c0| 63 70 73 65 72 76 65 72 | 28 31 29 2c 0a 67 65 74 |cpserver|(1),.get|
|000059d0| 70 65 65 72 6e 61 6d 65 | 28 33 29 2c 0a 67 65 74 |peername|(3),.get|
|000059e0| 73 6f 63 6b 6e 61 6d 65 | 28 33 29 2c 0a 74 63 70 |sockname|(3),.tcp|
|000059f0| 28 34 29 2c 0a 61 75 74 | 68 64 28 38 29 0a 00 00 |(4),.aut|hd(8)...|
|00005a00| 6c 69 62 61 75 74 68 2d | 34 2e 30 2d 70 35 2f 61 |libauth-|4.0-p5/a|
|00005a10| 75 74 68 75 73 65 72 2e | 68 00 00 00 00 00 00 00 |uthuser.|h.......|
|00005a20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005a30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005a40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005a50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005a60| 00 00 00 00 20 20 20 36 | 34 34 20 00 20 20 20 31 |.... 6|44 . 1|
|00005a70| 37 31 20 00 20 20 20 20 | 33 36 20 00 20 20 20 20 |71 . |36 . |
|00005a80| 20 20 20 20 36 32 30 20 | 20 35 33 33 33 34 34 31 | 620 | 5333441|
|00005a90| 34 31 35 20 20 31 30 33 | 35 31 00 20 00 00 00 00 |415 103|51. ....|
|00005aa0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005ab0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005ac0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005ad0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005ae0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005af0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005b00| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005b10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005b20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005b30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005b40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005b50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005b60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005b70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005b80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005b90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005ba0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005bb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005bc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005bd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005be0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005bf0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005c00| 23 69 66 6e 64 65 66 20 | 41 55 54 48 55 53 45 52 |#ifndef |AUTHUSER|
|00005c10| 5f 48 0a 23 64 65 66 69 | 6e 65 20 41 55 54 48 55 |_H.#defi|ne AUTHU|
|00005c20| 53 45 52 5f 48 0a 0a 65 | 78 74 65 72 6e 20 75 6e |SER_H..e|xtern un|
|00005c30| 73 69 67 6e 65 64 20 73 | 68 6f 72 74 20 61 75 74 |signed s|hort aut|
|00005c40| 68 5f 74 63 70 70 6f 72 | 74 3b 0a 65 78 74 65 72 |h_tcppor|t;.exter|
|00005c50| 6e 20 69 6e 74 20 20 20 | 20 20 20 20 20 20 20 20 |n int | |
|00005c60| 20 61 75 74 68 5f 72 74 | 69 6d 65 6f 75 74 3b 0a | auth_rt|imeout;.|
|00005c70| 0a 65 78 74 65 72 6e 20 | 63 68 61 72 20 2a 61 75 |.extern |char *au|
|00005c80| 74 68 5f 78 6c 69 6e 65 | 28 29 3b 0a 65 78 74 65 |th_xline|();.exte|
|00005c90| 72 6e 20 69 6e 74 20 61 | 75 74 68 5f 66 64 28 29 |rn int a|uth_fd()|
|00005ca0| 3b 0a 65 78 74 65 72 6e | 20 69 6e 74 20 61 75 74 |;.extern| int aut|
|00005cb0| 68 5f 66 64 32 28 29 3b | 0a 65 78 74 65 72 6e 20 |h_fd2();|.extern |
|00005cc0| 69 6e 74 20 61 75 74 68 | 5f 74 63 70 73 6f 63 6b |int auth|_tcpsock|
|00005cd0| 28 29 3b 0a 65 78 74 65 | 72 6e 20 63 68 61 72 20 |();.exte|rn char |
|00005ce0| 2a 61 75 74 68 5f 74 63 | 70 75 73 65 72 28 29 3b |*auth_tc|puser();|
|00005cf0| 0a 65 78 74 65 72 6e 20 | 63 68 61 72 20 2a 61 75 |.extern |char *au|
|00005d00| 74 68 5f 74 63 70 75 73 | 65 72 32 28 29 3b 0a 65 |th_tcpus|er2();.e|
|00005d10| 78 74 65 72 6e 20 63 68 | 61 72 20 2a 61 75 74 68 |xtern ch|ar *auth|
|00005d20| 5f 74 63 70 75 73 65 72 | 33 28 29 3b 0a 65 78 74 |_tcpuser|3();.ext|
|00005d30| 65 72 6e 20 63 68 61 72 | 20 2a 61 75 74 68 5f 74 |ern char| *auth_t|
|00005d40| 63 70 75 73 65 72 34 28 | 29 3b 0a 65 78 74 65 72 |cpuser4(|);.exter|
|00005d50| 6e 20 63 68 61 72 20 2a | 61 75 74 68 5f 73 6f 63 |n char *|auth_soc|
|00005d60| 6b 75 73 65 72 28 29 3b | 0a 65 78 74 65 72 6e 20 |kuser();|.extern |
|00005d70| 63 68 61 72 20 2a 61 75 | 74 68 5f 73 6f 63 6b 75 |char *au|th_socku|
|00005d80| 73 65 72 32 28 29 3b 0a | 0a 23 65 6e 64 69 66 0a |ser2();.|.#endif.|
|00005d90| 20 2a 5c 66 42 61 75 74 | 68 5f 74 63 70 75 73 65 | *\fBaut|h_tcpuse|
|00005da0| 72 28 5c 66 49 69 6e 72 | 65 6d 6f 74 65 2c 6c 6f |r(\fIinr|emote,lo|
|00005db0| 63 61 6c 2c 72 65 6d 6f | 74 65 5c 66 42 29 5c 66 |cal,remo|te\fB)\f|
|00005dc0| 52 3b 0a 2e 62 72 0a 63 | 68 61 72 20 2a 5c 66 42 |R;..br.c|har *\fB|
|00005dd0| 61 75 74 68 5f 74 63 70 | 75 73 65 72 32 28 5c 66 |auth_tcp|user2(\f|
|00005de0| 49 69 6e 6c 6f 63 61 6c | 2c 69 6e 72 65 6d 6f 74 |Iinlocal|,inremot|
|00005df0| 65 2c 6c 6f 63 61 6c 2c | 72 65 6d 6f 74 65 5c 66 |e,local,|remote\f|
|00005e00| 6c 69 62 61 75 74 68 2d | 34 2e 30 2d 70 35 2f 61 |libauth-|4.0-p5/a|
|00005e10| 75 74 68 75 73 65 72 2e | 63 00 00 00 00 00 00 00 |uthuser.|c.......|
|00005e20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005e30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005e40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005e50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005e60| 00 00 00 00 20 20 20 36 | 34 34 20 00 20 20 20 31 |.... 6|44 . 1|
|00005e70| 37 31 20 00 20 20 20 20 | 33 36 20 00 20 20 20 20 |71 . |36 . |
|00005e80| 20 20 32 30 32 34 31 20 | 20 35 34 30 30 37 33 32 | 20241 | 5400732|
|00005e90| 34 36 35 20 20 31 30 34 | 31 30 00 20 00 00 00 00 |465 104|10. ....|
|00005ea0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005eb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005ec0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005ed0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005ee0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005ef0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005f00| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005f10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005f20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005f30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005f40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005f50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005f60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005f70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005f80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005f90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005fa0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005fb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005fc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005fd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005fe0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005ff0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+